web: add confirmation before deleting failed inbox items

Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
01zulfi
2026-06-24 12:32:47 +05:00
committed by Abdullah Atta
parent cbddea4518
commit f2173a42d9
4 changed files with 30 additions and 2 deletions

View File

@@ -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} />

View File

@@ -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"

View File

@@ -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 ""

View File

@@ -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`
};