Skip to content

Commit

Permalink
fix(core): allow upgrade-success route in browser for electron
Browse files Browse the repository at this point in the history
  • Loading branch information
CatsJuice committed Apr 22, 2024
1 parent b2242bb commit f70c827
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/frontend/electron/renderer/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,16 @@ import type { PropsWithChildren, ReactElement } from 'react';
import { lazy, Suspense } from 'react';
import { RouterProvider } from 'react-router-dom';

const desktopWhiteList = [
'/desktop-signin',
'/open-app/signin-redirect',
'/upgrade-success',
'/ai-upgrade-success',
];
if (
!environment.isDesktop &&
environment.isDebug &&
!location.pathname.includes('/desktop-signin') &&
!location.pathname.includes('/open-app/signin-redirect')
desktopWhiteList.every(path => !location.pathname.startsWith(path))
) {
document.body.innerHTML = `<h1 style="color:red;font-size:5rem;text-align:center;">Don't run electron entry in browser.</h1>`;
throw new Error('Wrong distribution');
Expand Down

0 comments on commit f70c827

Please sign in to comment.