From a2c875accacf6fd69fc89002f4040764a1f50587 Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Fri, 18 Nov 2022 17:35:00 +0500 Subject: [PATCH] mobile: action strip functions for reminders --- .../list-items/selection-wrapper/action-strip.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/apps/mobile/app/components/list-items/selection-wrapper/action-strip.js b/apps/mobile/app/components/list-items/selection-wrapper/action-strip.js index 0c56e15a8..71fde4e1f 100644 --- a/apps/mobile/app/components/list-items/selection-wrapper/action-strip.js +++ b/apps/mobile/app/components/list-items/selection-wrapper/action-strip.js @@ -100,6 +100,7 @@ export const ActionStrip = ({ note, setActionStrip }) => { ? "Remove Shortcut from Menu" : "Add Shortcut to Menu", icon: isPinnedToMenu ? "link-variant-remove" : "link-variant", + visible: note.type !== "reminder", onPress: async () => { try { if (isPinnedToMenu) { @@ -223,6 +224,21 @@ export const ActionStrip = ({ note, setActionStrip }) => { icon: "delete", visible: note.type !== "trash", onPress: async () => { + if (note.type === "reminder") { + presentDialog({ + title: `Delete ${note.type}`, + paragraph: "This reminder will be removed", + positivePress: async () => { + const routes = []; + await db.reminders.remove(note.id); + routes.push("Reminders"); + Navigation.queueRoutesForUpdate(...routes); + }, + positiveText: "Delete", + positiveType: "errorShade" + }); + return; + } try { await deleteItems(note); } catch (e) {