Fix show/hide delete button

This commit is contained in:
Laurent Nguyen 2024-03-27 18:51:22 +01:00
parent 91633ee85c
commit c4b659cdf7

View File

@ -258,7 +258,7 @@ const DocumentsTabComponent: React.FunctionComponent<{
case ViewModels.DocumentExplorerState.exisitingDocumentNoEdits:
case ViewModels.DocumentExplorerState.exisitingDocumentDirtyInvalid:
case ViewModels.DocumentExplorerState.exisitingDocumentDirtyValid:
return true;
return selectedRows.size > 0;
default:
return false;
}
@ -329,7 +329,7 @@ const DocumentsTabComponent: React.FunctionComponent<{
}, []);
// If editor state changes, update the nav
// TODO Put whatever the buttons callback use in the dependency array
// TODO Put whatever the buttons callback use in the dependency array: find a better way to maintain
useEffect(
() => updateNavbarWithTabsButtons(),
[editorState, selectedDocumentContent, initialDocumentContent, selectedRows, documentIds],