From ee48990c90ad7e8bca625b8dba2eccbbb9dfe53b Mon Sep 17 00:00:00 2001 From: Ammar Ahmed Date: Thu, 21 May 2026 12:15:28 +0500 Subject: [PATCH] mobile: show delete-all button only when items are in list --- .../screens/settings/failed-inbox-items.tsx | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/apps/mobile/app/screens/settings/failed-inbox-items.tsx b/apps/mobile/app/screens/settings/failed-inbox-items.tsx index cb09c13f4..9beb1dfb9 100644 --- a/apps/mobile/app/screens/settings/failed-inbox-items.tsx +++ b/apps/mobile/app/screens/settings/failed-inbox-items.tsx @@ -195,26 +195,30 @@ export const FailedInboxItems = () => { title={strings.failedInboxItems()} canGoBack={true} id="Settings" - rightButton={{ - name: "delete", - color: colors.primary.icon, - onPress: async () => { - presentDialog({ - title: strings.deleteAll(), - paragraph: strings.deleteAllFailedItemsDesc(), - positiveText: strings.delete(), - positiveType: "errorShade", - positivePress: async () => { - if (result.status !== "pending") { - await db.inboxItemsHistory.deleteFailed(); - result.refresh(); - } + rightButton={ + items?.length > 0 + ? { + name: "delete", + color: colors.primary.icon, + onPress: async () => { + presentDialog({ + title: strings.deleteAll(), + paragraph: strings.deleteAllFailedItemsDesc(), + positiveText: strings.delete(), + positiveType: "errorShade", + positivePress: async () => { + if (result.status !== "pending") { + await db.inboxItemsHistory.deleteFailed(); + result.refresh(); + } - return true; + return true; + } + }); + } } - }); - } - }} + : undefined + } /> {result.status === "pending" ? (