fix: preventing save button from flickering in SQL Lab (#25106)

This commit is contained in:
Jack
2023-09-26 13:41:28 -05:00
committed by GitHub
parent 52eba11d6a
commit 296ff17f19
2 changed files with 28 additions and 5 deletions

View File

@@ -98,6 +98,8 @@ const SaveQuery = ({
const [showSaveDatasetModal, setShowSaveDatasetModal] = useState(false);
const isSaved = !!query.remoteId;
const canExploreDatabase = !!database?.allows_virtual_table_explore;
const shouldShowSaveButton =
database?.allows_virtual_table_explore !== undefined;
const overlayMenu = (
<Menu>
@@ -180,10 +182,12 @@ const SaveQuery = ({
return (
<Styles className="SaveQuery">
<SaveDatasetActionButton
setShowSave={setShowSave}
overlayMenu={canExploreDatabase ? overlayMenu : null}
/>
{shouldShowSaveButton && (
<SaveDatasetActionButton
setShowSave={setShowSave}
overlayMenu={canExploreDatabase ? overlayMenu : null}
/>
)}
<SaveDatasetModal
visible={showSaveDatasetModal}
onHide={() => setShowSaveDatasetModal(false)}