mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
fix: ensure current file saved before move/delete action
This commit is contained in:
@@ -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'),
|
||||
|
||||
Reference in New Issue
Block a user