fix: ensure current file saved before move/delete action

This commit is contained in:
purocean
2022-03-23 17:26:37 +08:00
parent 1140cc2d28
commit ecbbf78ee8
+4
View File
@@ -252,6 +252,8 @@ export async function deleteDoc (doc: Doc) {
throw new Error('Could\'t delete root dir.')
}
await ensureCurrentFileSaved()
const confirm = await useModal().confirm({
title: t('document.delete-dialog.title'),
content: t('document.delete-dialog.content', doc.path),
@@ -279,6 +281,8 @@ export async function moveDoc (doc: Doc, newPath?: string) {
throw new Error('Could\'t move/rename root dir.')
}
await ensureCurrentFileSaved()
newPath ??= await useModal().input({
title: t('document.move-dialog.title'),
hint: t('document.move-dialog.content'),