From c86b51aba2c96bda1e6bb1429516d90dfb07165d Mon Sep 17 00:00:00 2001 From: jwlee64 Date: Tue, 8 Oct 2024 11:17:55 -0700 Subject: [PATCH] hide delete if no calls are selected --- .../Browse3/pages/CallsPage/CallsTable.tsx | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallsPage/CallsTable.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallsPage/CallsTable.tsx index fc2b06ff632..3deaa2df604 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallsPage/CallsTable.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallsPage/CallsTable.tsx @@ -769,25 +769,27 @@ export const CallsTable: FC<{ disabled={selectedCalls.length === 0} /> )} - {!isReadonly && ( -
- setDeleteConfirmModalOpen(true)} - disabled={selectedCalls.length === 0} - /> - selectedCalls.includes(row.id)) - .map(traceCallToUICallSchema)} - confirmDelete={deleteConfirmModalOpen} - setConfirmDelete={setDeleteConfirmModalOpen} - onDeleteCallback={() => { - setSelectedCalls([]); - }} - /> -
+ {!isReadonly && selectedCalls.length !== 0 && ( + <> +
+ setDeleteConfirmModalOpen(true)} + disabled={selectedCalls.length === 0} + /> + selectedCalls.includes(row.id)) + .map(traceCallToUICallSchema)} + confirmDelete={deleteConfirmModalOpen} + setConfirmDelete={setDeleteConfirmModalOpen} + onDeleteCallback={() => { + setSelectedCalls([]); + }} + /> +
+ + )} -