Skip to content

Commit 4572725

Browse files
committed
fix
1 parent d646c38 commit 4572725

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

packages/compass-schema/src/components/compass-schema.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,7 @@ const Schema: React.FunctionComponent<{
434434
</WorkspaceContainer>
435435
</div>
436436
{enableExportSchema && <ExportSchemaModal />}
437-
{enableExportSchema && !dontShowLegacyBanner && (
438-
<ExportSchemaLegacyBanner />
439-
)}
437+
{enableExportSchema && <ExportSchemaLegacyBanner />}
440438
</>
441439
);
442440
};
@@ -447,7 +445,6 @@ export default connect(
447445
errorMessage: state.schemaAnalysis.errorMessage,
448446
schema: state.schemaAnalysis.schema,
449447
resultId: state.schemaAnalysis.resultId,
450-
dontShowLegacyBanner: state.schemaExport.dontShowLegacyBanner,
451448
}),
452449
{
453450
onStartAnalysis: startAnalysis,

packages/compass-schema/src/components/export-schema-legacy-banner.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ const ExportSchemaLegacyBanner: React.FunctionComponent<{
468468
onClose: () => void;
469469
onLegacyShare: () => void;
470470
onSwitchToSchemaExport: () => void;
471-
stopShowingLegacyBanner: () => void;
471+
stopShowingLegacyBanner: (choice: 'legacy' | 'export') => void;
472472
}> = ({
473473
isOpen,
474474
onClose,
@@ -478,11 +478,11 @@ const ExportSchemaLegacyBanner: React.FunctionComponent<{
478478
}) => {
479479
const [dontShowAgainChecked, setDontShowAgainChecked] = useState(false);
480480
const handleLegacyShare = useCallback(() => {
481-
if (dontShowAgainChecked) stopShowingLegacyBanner();
481+
if (dontShowAgainChecked) stopShowingLegacyBanner('legacy');
482482
onLegacyShare();
483483
}, [onLegacyShare, dontShowAgainChecked, stopShowingLegacyBanner]);
484484
const handleSwitchToNew = useCallback(() => {
485-
if (dontShowAgainChecked) stopShowingLegacyBanner();
485+
if (dontShowAgainChecked) stopShowingLegacyBanner('export');
486486
onSwitchToSchemaExport();
487487
}, [onSwitchToSchemaExport, dontShowAgainChecked, stopShowingLegacyBanner]);
488488
return (
@@ -541,6 +541,7 @@ export default connect(
541541
onClose: () => dispatch({ type: SchemaExportActions.closeLegacyBanner }),
542542
onLegacyShare: () => dispatch(confirmedLegacySchemaShare()),
543543
onSwitchToSchemaExport: () => dispatch(switchToSchemaExport()),
544-
stopShowingLegacyBanner: () => dispatch(stopShowingLegacyBanner()),
544+
stopShowingLegacyBanner: (choice: 'legacy' | 'export') =>
545+
dispatch(stopShowingLegacyBanner(choice)),
545546
})
546547
)(ExportSchemaLegacyBanner);

0 commit comments

Comments
 (0)