mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +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.
|
||||
* 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
|
||||
|
@ -256,7 +256,6 @@ export default class DesktopLayout {
|
||||
.child(new PasswordNoteSetDialog())
|
||||
|
||||
.child(new UploadAttachmentsDialog())
|
||||
.child(new DeleteNotesDialog())
|
||||
.child(new InfoDialog())
|
||||
|
||||
.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 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())
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user