mobile: fix individual note history version deletion

Signed-off-by: kashaf-ansari-dev <kashafansari3108@gmail.com>
This commit is contained in:
kashaf-ansari-dev
2026-07-07 19:16:44 +05:00
parent f6c31d19d8
commit c8cf4ce52a

View File

@@ -112,19 +112,23 @@ export default function NotePreview({
paragraph: strings.deleteNoteConfirmation(),
positiveText: strings.delete(),
negativeText: strings.cancel(),
context: "local",
context: "preview",
positivePress: async () => {
if (note) {
if (session) {
await db.noteHistory.remove(session.id);
eSendEvent(eCloseSheet, "note_history");
Navigation.queueRoutesForUpdate();
} else if (note.type === "trash") {
await db.trash.delete(note.id);
useTrashStore.getState().refresh();
useSelectionStore.getState().setSelectionMode();
ToastManager.show({
heading: strings.noteDeleted(),
type: "success",
context: "local"
});
eSendEvent(eCloseSheet);
}
ToastManager.show({
heading: strings.noteDeleted(),
type: "success"
});
eSendEvent(eCloseSheet);
},
positiveType: "error"
});
@@ -137,7 +141,7 @@ export default function NotePreview({
width: "100%"
}}
>
<Dialog context="local" />
<Dialog context="preview" />
<DialogHeader
padding={12}
title={content?.title || note.title || session?.session}