mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-20 16:43:53 +01:00
Toast after data export
This commit is contained in:
@@ -4,12 +4,14 @@ import { ExportDataDialog } from '../components/ExportDataDialog';
|
||||
import { useActiveWorkspace } from './useActiveWorkspace';
|
||||
import { useAlert } from './useAlert';
|
||||
import { useWorkspaces } from './useWorkspaces';
|
||||
import { useToast } from '../components/ToastContext';
|
||||
|
||||
export function useExportData() {
|
||||
const workspaces = useWorkspaces();
|
||||
const activeWorkspace = useActiveWorkspace();
|
||||
const alert = useAlert();
|
||||
const dialog = useDialog();
|
||||
const toast = useToast();
|
||||
|
||||
return useMutation({
|
||||
onError: (err: string) => {
|
||||
@@ -28,6 +30,12 @@ export function useExportData() {
|
||||
onHide={hide}
|
||||
workspaces={workspaces}
|
||||
activeWorkspace={activeWorkspace}
|
||||
onSuccess={() => {
|
||||
toast.show({
|
||||
variant: 'success',
|
||||
message: 'Data export successful',
|
||||
});
|
||||
}}
|
||||
/>
|
||||
),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user