mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
feat(mobile): request confirmation for deleting notes
This commit is contained in:
parent
8163d2d904
commit
4e7a7e334e
@ -21,6 +21,7 @@
|
|||||||
* Optimized the content in order to reduce the size on disk.
|
* Optimized the content in order to reduce the size on disk.
|
||||||
* Mobile improvements:
|
* Mobile improvements:
|
||||||
* The following dialogs are now accessible: bulk actions, branch prefix, include note, add link, sort child notes, note type selector, move/clone to, import/export, markdown import, note revisions
|
* The following dialogs are now accessible: bulk actions, branch prefix, include note, add link, sort child notes, note type selector, move/clone to, import/export, markdown import, note revisions
|
||||||
|
* Delete notes now requests confirmation.
|
||||||
* Modals now have a safe margin on their bottom and are scrollable.
|
* Modals now have a safe margin on their bottom and are scrollable.
|
||||||
|
|
||||||
## 🌍 Internationalization
|
## 🌍 Internationalization
|
||||||
|
@ -256,7 +256,6 @@ export default class DesktopLayout {
|
|||||||
.child(new PasswordNoteSetDialog())
|
.child(new PasswordNoteSetDialog())
|
||||||
|
|
||||||
.child(new UploadAttachmentsDialog())
|
.child(new UploadAttachmentsDialog())
|
||||||
.child(new DeleteNotesDialog())
|
|
||||||
.child(new InfoDialog())
|
.child(new InfoDialog())
|
||||||
|
|
||||||
.child(new CloseZenButton());
|
.child(new CloseZenButton());
|
||||||
|
@ -19,6 +19,7 @@ import MarkdownImportDialog from "../widgets/dialogs/markdown_import.js";
|
|||||||
import ProtectedSessionPasswordDialog from "../widgets/dialogs/protected_session_password.js";
|
import ProtectedSessionPasswordDialog from "../widgets/dialogs/protected_session_password.js";
|
||||||
import ConfirmDialog from "../widgets/dialogs/confirm.js";
|
import ConfirmDialog from "../widgets/dialogs/confirm.js";
|
||||||
import RevisionsDialog from "../widgets/dialogs/revisions.js";
|
import RevisionsDialog from "../widgets/dialogs/revisions.js";
|
||||||
|
import DeleteNotesDialog from "../widgets/dialogs/delete_notes.js";
|
||||||
|
|
||||||
export function applyModals(rootContainer: RootContainer) {
|
export function applyModals(rootContainer: RootContainer) {
|
||||||
rootContainer
|
rootContainer
|
||||||
@ -39,7 +40,7 @@ export function applyModals(rootContainer: RootContainer) {
|
|||||||
.child(new MarkdownImportDialog())
|
.child(new MarkdownImportDialog())
|
||||||
.child(new ProtectedSessionPasswordDialog())
|
.child(new ProtectedSessionPasswordDialog())
|
||||||
.child(new RevisionsDialog())
|
.child(new RevisionsDialog())
|
||||||
// .child(new DeleteNotesDialog())
|
.child(new DeleteNotesDialog())
|
||||||
// .child(new InfoDialog())
|
// .child(new InfoDialog())
|
||||||
.child(new ConfirmDialog())
|
.child(new ConfirmDialog())
|
||||||
.child(new PromptDialog())
|
.child(new PromptDialog())
|
||||||
|
@ -102,16 +102,9 @@ async function deleteNotes(branchIdsToDelete: string[], forceDeleteAllClones = f
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let proceed, deleteAllClones, eraseNotes;
|
const { proceed, deleteAllClones, eraseNotes } = await new Promise<ResolveOptions>((res) =>
|
||||||
|
appContext.triggerCommand("showDeleteNotesDialog", { branchIdsToDelete, callback: res, forceDeleteAllClones })
|
||||||
if (utils.isMobile()) {
|
);
|
||||||
proceed = true;
|
|
||||||
deleteAllClones = false;
|
|
||||||
} else {
|
|
||||||
({ proceed, deleteAllClones, eraseNotes } = await new Promise<ResolveOptions>((res) =>
|
|
||||||
appContext.triggerCommand("showDeleteNotesDialog", { branchIdsToDelete, callback: res, forceDeleteAllClones })
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!proceed) {
|
if (!proceed) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user