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;
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);

View File

@ -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;

View File

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