From 470b47027dc84ea8ba516b9eb73b433eca36b9ef Mon Sep 17 00:00:00 2001
From: Darran Boyd <dboyd13@gmail.com>
Date: Mon, 11 Nov 2024 19:51:54 +1100
Subject: [PATCH] fix: memory router mode for browser extension (#147)

Co-authored-by: Darran Boyd <drboyd@example.com>
---
 .../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<ThreatModelProps> = ({
     <ThreatModelView
       {...props}
       onPrintButtonClick={() => 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}