From 990df2a392dcf750d6220e2e8efd3d55bab3bc5f Mon Sep 17 00:00:00 2001 From: Ammar Ahmed Date: Tue, 18 Feb 2025 10:29:32 +0500 Subject: [PATCH] mobile: fix missing delete button in trash --- .../app/components/properties/items.tsx | 3 ++- apps/mobile/app/hooks/use-actions.tsx | 25 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/apps/mobile/app/components/properties/items.tsx b/apps/mobile/app/components/properties/items.tsx index 660551333..f0a0d199f 100644 --- a/apps/mobile/app/components/properties/items.tsx +++ b/apps/mobile/app/components/properties/items.tsx @@ -71,7 +71,8 @@ const COLUMN_BAR_ITEMS: ActionId[] = [ "rename-color", "rename-tag", "restore", - "trash" + "trash", + "delete" ]; export const Items = ({ item, close }: { item: Item; close: () => void }) => { diff --git a/apps/mobile/app/hooks/use-actions.tsx b/apps/mobile/app/hooks/use-actions.tsx index 527df5e7e..9a4b4d516 100644 --- a/apps/mobile/app/hooks/use-actions.tsx +++ b/apps/mobile/app/hooks/use-actions.tsx @@ -977,19 +977,18 @@ export const useActions = ({ } } - actions.push({ - id: "trash", - title: - item.type !== "notebook" && item.type !== "note" - ? strings.doActions.delete.unknown( - item.type === "trash" ? item.itemType : item.type, - 1 - ) - : strings.moveToTrash(), - icon: "delete-outline", - type: "error", - onPress: deleteItem - }); + if (item.type != "trash") { + actions.push({ + id: "trash", + title: + item.type !== "notebook" && item.type !== "note" + ? strings.doActions.delete.unknown(item.type, 1) + : strings.moveToTrash(), + icon: "delete-outline", + type: "error", + onPress: deleteItem + }); + } return actions; };