feat(core): add ai subscription landing page (#6657)

This commit is contained in:
CatsJuice
2024-04-22 09:03:27 +00:00
parent d36b5e14aa
commit e13024580d
8 changed files with 93 additions and 51 deletions

View File

@@ -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');