mirror of https://github.com/buster-so/buster.git
update here
This commit is contained in:
parent
905e70e3c5
commit
5e9a38687c
|
@ -20,7 +20,6 @@ export const NewDatasetModal: React.FC<{
|
|||
afterCreate?: () => void;
|
||||
datasourceId?: string;
|
||||
}> = React.memo(({ open, onClose, beforeCreate, afterCreate, datasourceId }) => {
|
||||
const router = useRouter();
|
||||
const onChangePage = useAppLayoutContextSelector((s) => s.onChangePage);
|
||||
const { mutateAsync: createDataset, isPending: creatingDataset } = useCreateDataset();
|
||||
const [selectedDatasource, setSelectedDatasource] = React.useState<string | null>(
|
||||
|
@ -54,7 +53,7 @@ export const NewDatasetModal: React.FC<{
|
|||
});
|
||||
|
||||
const onAddDataSourceClick = useMemoizedFn(() => {
|
||||
router.push(createBusterRoute({ route: BusterRoutes.SETTINGS_DATASOURCES_ADD }));
|
||||
onChangePage(createBusterRoute({ route: BusterRoutes.SETTINGS_DATASOURCES_ADD }));
|
||||
setTimeout(() => {
|
||||
onClose();
|
||||
}, 450);
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import { queryKeys } from '@/api/query_keys';
|
||||
import { useBusterNotifications } from '@/context/BusterNotifications';
|
||||
import { BusterRoutes, createBusterRoute } from '@/routes/busterRoutes';
|
||||
import { BusterRoutes } from '@/routes/busterRoutes';
|
||||
import { useMemoizedFn } from 'ahooks';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { useSocketQueryMutation } from '@/api/buster_socket_query';
|
||||
import { useQueryClient } from '@tanstack/react-query';
|
||||
import { useAppLayoutContextSelector } from '@/context/BusterAppLayout';
|
||||
|
||||
export const useDashboardCreate = ({}: {}) => {
|
||||
const router = useRouter();
|
||||
const onChangePage = useAppLayoutContextSelector((x) => x.onChangePage);
|
||||
const queryClient = useQueryClient();
|
||||
const { mutateAsync: deleteDashboard, isPending: isDeletingDashboard } = useSocketQueryMutation({
|
||||
emitEvent: '/dashboards/delete',
|
||||
|
@ -44,12 +44,10 @@ export const useDashboardCreate = ({}: {}) => {
|
|||
const res = await createDashboard({ ...rest, name: rest.name || '' });
|
||||
|
||||
if (rerouteToDashboard) {
|
||||
router.push(
|
||||
createBusterRoute({
|
||||
route: BusterRoutes.APP_DASHBOARD_ID,
|
||||
dashboardId: res.dashboard.id
|
||||
})
|
||||
);
|
||||
onChangePage({
|
||||
route: BusterRoutes.APP_DASHBOARD_ID,
|
||||
dashboardId: res.dashboard.id
|
||||
});
|
||||
}
|
||||
|
||||
return res.dashboard;
|
||||
|
|
|
@ -59,8 +59,9 @@ export const useChatLayout = ({
|
|||
|
||||
if (route) {
|
||||
setRenderViewLayoutKey('both');
|
||||
onChangePage(route);
|
||||
startTransition(() => {
|
||||
console.log('HERE! FIX THIS HERE!');
|
||||
onChangePage(route);
|
||||
animateOpenSplitter('both');
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue