update here

This commit is contained in:
Nate Kelley 2025-03-05 17:19:12 -07:00
parent 905e70e3c5
commit 5e9a38687c
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
3 changed files with 10 additions and 12 deletions

View File

@ -20,7 +20,6 @@ export const NewDatasetModal: React.FC<{
afterCreate?: () => void; afterCreate?: () => void;
datasourceId?: string; datasourceId?: string;
}> = React.memo(({ open, onClose, beforeCreate, afterCreate, datasourceId }) => { }> = React.memo(({ open, onClose, beforeCreate, afterCreate, datasourceId }) => {
const router = useRouter();
const onChangePage = useAppLayoutContextSelector((s) => s.onChangePage); const onChangePage = useAppLayoutContextSelector((s) => s.onChangePage);
const { mutateAsync: createDataset, isPending: creatingDataset } = useCreateDataset(); const { mutateAsync: createDataset, isPending: creatingDataset } = useCreateDataset();
const [selectedDatasource, setSelectedDatasource] = React.useState<string | null>( const [selectedDatasource, setSelectedDatasource] = React.useState<string | null>(
@ -54,7 +53,7 @@ export const NewDatasetModal: React.FC<{
}); });
const onAddDataSourceClick = useMemoizedFn(() => { const onAddDataSourceClick = useMemoizedFn(() => {
router.push(createBusterRoute({ route: BusterRoutes.SETTINGS_DATASOURCES_ADD })); onChangePage(createBusterRoute({ route: BusterRoutes.SETTINGS_DATASOURCES_ADD }));
setTimeout(() => { setTimeout(() => {
onClose(); onClose();
}, 450); }, 450);

View File

@ -1,13 +1,13 @@
import { queryKeys } from '@/api/query_keys'; import { queryKeys } from '@/api/query_keys';
import { useBusterNotifications } from '@/context/BusterNotifications'; import { useBusterNotifications } from '@/context/BusterNotifications';
import { BusterRoutes, createBusterRoute } from '@/routes/busterRoutes'; import { BusterRoutes } from '@/routes/busterRoutes';
import { useMemoizedFn } from 'ahooks'; import { useMemoizedFn } from 'ahooks';
import { useRouter } from 'next/navigation';
import { useSocketQueryMutation } from '@/api/buster_socket_query'; import { useSocketQueryMutation } from '@/api/buster_socket_query';
import { useQueryClient } from '@tanstack/react-query'; import { useQueryClient } from '@tanstack/react-query';
import { useAppLayoutContextSelector } from '@/context/BusterAppLayout';
export const useDashboardCreate = ({}: {}) => { export const useDashboardCreate = ({}: {}) => {
const router = useRouter(); const onChangePage = useAppLayoutContextSelector((x) => x.onChangePage);
const queryClient = useQueryClient(); const queryClient = useQueryClient();
const { mutateAsync: deleteDashboard, isPending: isDeletingDashboard } = useSocketQueryMutation({ const { mutateAsync: deleteDashboard, isPending: isDeletingDashboard } = useSocketQueryMutation({
emitEvent: '/dashboards/delete', emitEvent: '/dashboards/delete',
@ -44,12 +44,10 @@ export const useDashboardCreate = ({}: {}) => {
const res = await createDashboard({ ...rest, name: rest.name || '' }); const res = await createDashboard({ ...rest, name: rest.name || '' });
if (rerouteToDashboard) { if (rerouteToDashboard) {
router.push( onChangePage({
createBusterRoute({ route: BusterRoutes.APP_DASHBOARD_ID,
route: BusterRoutes.APP_DASHBOARD_ID, dashboardId: res.dashboard.id
dashboardId: res.dashboard.id });
})
);
} }
return res.dashboard; return res.dashboard;

View File

@ -59,8 +59,9 @@ export const useChatLayout = ({
if (route) { if (route) {
setRenderViewLayoutKey('both'); setRenderViewLayoutKey('both');
onChangePage(route);
startTransition(() => { startTransition(() => {
console.log('HERE! FIX THIS HERE!');
onChangePage(route);
animateOpenSplitter('both'); animateOpenSplitter('both');
}); });
} }