Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: add confirmation before deleting failed inbox items Signed-off-by: 01zulfi <[email protected]>

01zulfif2173a42d91b
diff --git a/apps/web/src/dialogs/inbox-history-dialog.tsx b/apps/web/src/dialogs/inbox-history-dialog.tsx
index 88d5aba81..f76285e4e 100644
--- a/apps/web/src/dialogs/inbox-history-dialog.tsx
+++ b/apps/web/src/dialogs/inbox-history-dialog.tsx
@@ -31,6 +31,7 @@ import ScrollContainer, {
import { strings } from "@notesnook/intl";
import { writeText } from "clipboard-polyfill";
import { showToast } from "../utils/toast";
+import { ConfirmDialog } from "./confirm";
type InboxHistoryDialogProps = BaseDialogProps<boolean>;
@@ -161,6 +162,14 @@ export const InboxHistoryDialog = DialogManager.register(
}
async function deleteAll() {
+ const ok = await ConfirmDialog.show({
+ title: strings.deleteAll(),
+ subtitle: strings.deleteAllFailedItemsDesc(),
+ positiveButtonText: strings.yes(),
+ negativeButtonText: strings.no()
+ });
+ if (!ok) return;
+
await db.inboxItemsHistory.deleteFailed();
showToast("success", strings.allItemsDeleted());
if (result.status !== "pending") {
@@ -266,7 +275,17 @@ export const InboxHistoryDialog = DialogManager.register(
<Button
variant="icon"
title={strings.delete()}
- onClick={() => deleteItem(item.id)}
+ onClick={async () => {
+ const ok = await ConfirmDialog.show({
+ title: strings.deleteItem(),
+ subtitle: strings.areYouSure(),
+ positiveButtonText: strings.yes(),
+ negativeButtonText: strings.no()
+ });
+ if (!ok) return;
+
+ deleteItem(item.id);
+ }}
sx={{ color: "accent-error", p: "2px" }}
>
<Trash size={16} />
diff --git a/packages/intl/locale/en.po b/packages/intl/locale/en.po
index 324901fff..f02a9fe27 100644
--- a/packages/intl/locale/en.po
+++ b/packages/intl/locale/en.po
@@ -2315,6 +2315,10 @@ msgstr "Delete data"
msgid "Delete group"
msgstr "Delete group"
+#: src/strings.ts:2799
+msgid "Delete item"
+msgstr "Delete item"
+
#: src/strings.ts:2379
msgid "Delete mode"
msgstr "Delete mode"
diff --git a/packages/intl/locale/pseudo-LOCALE.po b/packages/intl/locale/pseudo-LOCALE.po
index 71315b607..ca323cf1d 100644
--- a/packages/intl/locale/pseudo-LOCALE.po
+++ b/packages/intl/locale/pseudo-LOCALE.po
@@ -2304,6 +2304,10 @@ msgstr ""
msgid "Delete group"
msgstr ""
+#: src/strings.ts:2799
+msgid "Delete item"
+msgstr ""
+
#: src/strings.ts:2379
msgid "Delete mode"
msgstr ""
diff --git a/packages/intl/src/strings.ts b/packages/intl/src/strings.ts
index 93f273590..4be3ad090 100644
--- a/packages/intl/src/strings.ts
+++ b/packages/intl/src/strings.ts
@@ -2795,5 +2795,6 @@ Continue without attachments?`,
colorNotePasswordFor: (filename: string) =>
t`Colornote password for ${filename}`,
colorNotPasswordForDesc: () =>
- t`The password for decrypting the Colornote backup file.`
+ t`The password for decrypting the Colornote backup file.`,
+ deleteItem: () => t`Delete item`
};