Skip to content

Build your personal knowledge base with Trilium Notes

feat(mobile): request confirmation for deleting notes

Elian Doran4e7a7e334e20
diff --git a/docs/Release Notes/Release Notes/v0.92.8-beta.md b/docs/Release Notes/Release Notes/v0.92.8-beta.md
index 803a2bfd0f..570cd2c30b 100644
--- a/docs/Release Notes/Release Notes/v0.92.8-beta.md
+++ b/docs/Release Notes/Release Notes/v0.92.8-beta.md
@@ -21,6 +21,7 @@
* Optimized the content in order to reduce the size on disk.
* 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
+ * Delete notes now requests confirmation.
* Modals now have a safe margin on their bottom and are scrollable.
## 🌍 Internationalization
diff --git a/src/public/app/layouts/desktop_layout.ts b/src/public/app/layouts/desktop_layout.ts
index 3113d3bfa5..74be93f6fb 100644
--- a/src/public/app/layouts/desktop_layout.ts
+++ b/src/public/app/layouts/desktop_layout.ts
@@ -256,7 +256,6 @@ export default class DesktopLayout {
.child(new PasswordNoteSetDialog())
.child(new UploadAttachmentsDialog())
- .child(new DeleteNotesDialog())
.child(new InfoDialog())
.child(new CloseZenButton());
diff --git a/src/public/app/layouts/layout_commons.ts b/src/public/app/layouts/layout_commons.ts
index d34c847a9c..fc3679acea 100644
--- a/src/public/app/layouts/layout_commons.ts
+++ b/src/public/app/layouts/layout_commons.ts
@@ -19,6 +19,7 @@ import MarkdownImportDialog from "../widgets/dialogs/markdown_import.js";
import ProtectedSessionPasswordDialog from "../widgets/dialogs/protected_session_password.js";
import ConfirmDialog from "../widgets/dialogs/confirm.js";
import RevisionsDialog from "../widgets/dialogs/revisions.js";
+import DeleteNotesDialog from "../widgets/dialogs/delete_notes.js";
export function applyModals(rootContainer: RootContainer) {
rootContainer
@@ -39,7 +40,7 @@ export function applyModals(rootContainer: RootContainer) {
.child(new MarkdownImportDialog())
.child(new ProtectedSessionPasswordDialog())
.child(new RevisionsDialog())
- // .child(new DeleteNotesDialog())
+ .child(new DeleteNotesDialog())
// .child(new InfoDialog())
.child(new ConfirmDialog())
.child(new PromptDialog())
diff --git a/src/public/app/services/branches.ts b/src/public/app/services/branches.ts
index b6f562f7c9..d551ba06ce 100644
--- a/src/public/app/services/branches.ts
+++ b/src/public/app/services/branches.ts
@@ -102,16 +102,9 @@ async function deleteNotes(branchIdsToDelete: string[], forceDeleteAllClones = f
return false;
}
- let proceed, deleteAllClones, eraseNotes;
-
- if (utils.isMobile()) {
- proceed = true;
- deleteAllClones = false;
- } else {
- ({ proceed, deleteAllClones, eraseNotes } = await new Promise<ResolveOptions>((res) =>
- appContext.triggerCommand("showDeleteNotesDialog", { branchIdsToDelete, callback: res, forceDeleteAllClones })
- ));
- }
+ const { proceed, deleteAllClones, eraseNotes } = await new Promise<ResolveOptions>((res) =>
+ appContext.triggerCommand("showDeleteNotesDialog", { branchIdsToDelete, callback: res, forceDeleteAllClones })
+ );
if (!proceed) {
return false;