From 861330725f06ec2470af78ccd5d2f95cb25a7a63 Mon Sep 17 00:00:00 2001 From: Darran Boyd Date: Fri, 8 Nov 2024 16:19:33 +1100 Subject: [PATCH] fix:memory router mode for browser extension --- .../threat-composer-app/src/utils/isMemoryRouterUsed/index.ts | 4 ++-- .../src/components/report/ThreatModel/index.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/threat-composer-app/src/utils/isMemoryRouterUsed/index.ts b/packages/threat-composer-app/src/utils/isMemoryRouterUsed/index.ts index 5db6c8dd..78f819f5 100644 --- a/packages/threat-composer-app/src/utils/isMemoryRouterUsed/index.ts +++ b/packages/threat-composer-app/src/utils/isMemoryRouterUsed/index.ts @@ -13,12 +13,12 @@ See the License for the specific language governing permissions and limitations under the License. ******************************************************************************************************************** */ -import { APP_MODE_IDE_EXTENSION } from '@aws/threat-composer'; +import { APP_MODE_IDE_EXTENSION, APP_MODE_BROWSER_EXTENSION } from '@aws/threat-composer'; const appMode = process.env.REACT_APP_APP_MODE; const isMemoryRouterUsed = () => { - return appMode === APP_MODE_IDE_EXTENSION; + return appMode === APP_MODE_IDE_EXTENSION || appMode === APP_MODE_BROWSER_EXTENSION; }; export default isMemoryRouterUsed; \ No newline at end of file diff --git a/packages/threat-composer/src/components/report/ThreatModel/index.tsx b/packages/threat-composer/src/components/report/ThreatModel/index.tsx index c1c09a55..3a87a195 100644 --- a/packages/threat-composer/src/components/report/ThreatModel/index.tsx +++ b/packages/threat-composer/src/components/report/ThreatModel/index.tsx @@ -15,7 +15,7 @@ ******************************************************************************************************************** */ import { FC, useMemo } from 'react'; import ThreatModelView, { ThreatModelViewProps } from './components/ThreatModelView'; -import { APP_MODE_IDE_EXTENSION } from '../../../configs/appMode'; +import { APP_MODE_IDE_EXTENSION, APP_MODE_BROWSER_EXTENSION } from '../../../configs/appMode'; import { useGlobalSetupContext, useWorkspacesContext } from '../../../contexts'; import { DataExchangeFormat, ViewNavigationEvent } from '../../../customTypes'; import useImportExport from '../../../hooks/useExportImport'; @@ -49,7 +49,7 @@ const ThreatModel: FC = ({ onPrintButtonClick?.(getWorkspaceData())} - showPrintDownloadButtons={appMode !== APP_MODE_IDE_EXTENSION} + showPrintDownloadButtons={appMode !== APP_MODE_IDE_EXTENSION && appMode !== APP_MODE_BROWSER_EXTENSION } composerMode={composerMode} data={getWorkspaceData()} downloadFileName={downloadFileName}