mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-06-11 17:12:47 +02:00
A bunch of changes, including moving prompt/confirm out of context
This commit is contained in:
@@ -2,22 +2,21 @@ import type { Folder } from '@yaakapp-internal/models';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { InlineCode } from '../components/core/InlineCode';
|
||||
import { trackEvent } from '../lib/analytics';
|
||||
import { showConfirm } from '../lib/confirm';
|
||||
import { getFolder } from '../lib/store';
|
||||
import { invokeCmd } from '../lib/tauri';
|
||||
import { useConfirm } from './useConfirm';
|
||||
import { useFastMutation } from './useFastMutation';
|
||||
import { foldersAtom } from './useFolders';
|
||||
import { removeModelById } from './useSyncModelStores';
|
||||
import { useFastMutation } from './useFastMutation';
|
||||
|
||||
export function useDeleteFolder(id: string | null) {
|
||||
const confirm = useConfirm();
|
||||
const setFolders = useSetAtom(foldersAtom);
|
||||
|
||||
return useFastMutation<Folder | null, string>({
|
||||
mutationKey: ['delete_folder', id],
|
||||
mutationFn: async () => {
|
||||
const folder = await getFolder(id);
|
||||
const confirmed = await confirm({
|
||||
const confirmed = await showConfirm({
|
||||
id: 'delete-folder',
|
||||
title: 'Delete Folder',
|
||||
variant: 'delete',
|
||||
|
||||
Reference in New Issue
Block a user