Skip to content

Commit

Permalink
fix: memory router mode for browser extension (#147)
Browse files Browse the repository at this point in the history
Co-authored-by: Darran Boyd <[email protected]>
  • Loading branch information
dboyd13 and Darran Boyd authored Nov 11, 2024
1 parent 23cf462 commit 470b470
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 470b470

Please sign in to comment.