mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-07-09 20:09:36 +02:00
web: add confirmation before deleting failed inbox items
Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
@@ -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} />
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 ""
|
||||
|
||||
@@ -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`
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user