mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-26 11:21:16 +01:00
Remove useNavigate everywhere, and make request a query param. And convert dialog to Jotai
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { useNavigate } from '@tanstack/react-router';
|
||||
import type { Workspace } from '@yaakapp-internal/models';
|
||||
import { InlineCode } from '../components/core/InlineCode';
|
||||
import { trackEvent } from '../lib/analytics';
|
||||
import { router } from '../lib/router';
|
||||
import { invokeCmd } from '../lib/tauri';
|
||||
import { getActiveWorkspace } from './useActiveWorkspace';
|
||||
import { useConfirm } from './useConfirm';
|
||||
@@ -9,7 +9,6 @@ import { useFastMutation } from './useFastMutation';
|
||||
|
||||
export function useDeleteActiveWorkspace() {
|
||||
const confirm = useConfirm();
|
||||
const navigate = useNavigate();
|
||||
|
||||
return useFastMutation<Workspace | null, string>({
|
||||
mutationKey: ['delete_workspace'],
|
||||
@@ -31,7 +30,7 @@ export function useDeleteActiveWorkspace() {
|
||||
onSettled: () => trackEvent('workspace', 'delete'),
|
||||
onSuccess: async (workspace) => {
|
||||
if (workspace === null) return;
|
||||
await navigate({ to: '/workspaces' });
|
||||
await router.navigate({ to: '/workspaces' });
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user