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 17c0e0e commit f46db34
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/frontend/electron/renderer/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,15 @@ 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',
];
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 f46db34

Please sign in to comment.