mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-31 17:19:56 +08:00
refactor: migrate environment to BUILD_CONFIG (#8206)
This commit is contained in:
@@ -29,11 +29,6 @@ import { RouterProvider } from 'react-router-dom';
|
||||
import { configureMobileModules } from './modules';
|
||||
import { router } from './router';
|
||||
|
||||
if (environment.isElectron && environment.isDebug) {
|
||||
document.body.innerHTML = `<h1 style="color:red;font-size:5rem;text-align:center;">Don't run web entry in electron.</h1>`;
|
||||
throw new Error('Wrong distribution');
|
||||
}
|
||||
|
||||
const future = {
|
||||
v7_startTransition: true,
|
||||
} as const;
|
||||
|
||||
@@ -20,7 +20,7 @@ import { App } from './app';
|
||||
const performanceMainLogger = performanceLogger.namespace('main');
|
||||
function main() {
|
||||
performanceMainLogger.info('setup start');
|
||||
if (window.SENTRY_RELEASE || environment.isDebug) {
|
||||
if (BUILD_CONFIG.debug || window.SENTRY_RELEASE) {
|
||||
// https://docs.sentry.io/platforms/javascript/guides/react/#configure
|
||||
init({
|
||||
dsn: process.env.SENTRY_DSN,
|
||||
|
||||
@@ -125,8 +125,8 @@ export const Component = () => {
|
||||
|
||||
if (workspaceNotFound) {
|
||||
if (
|
||||
detailDocRoute /* */ &&
|
||||
environment.isDesktopEdition /* only browser has share page */
|
||||
BUILD_CONFIG.isDesktopEdition /* only browser has share page */ &&
|
||||
detailDocRoute
|
||||
) {
|
||||
return <div>TODO: share page</div>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user