mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 05:14:54 +00:00
refactor: migrate environment to BUILD_CONFIG (#8206)
This commit is contained in:
@@ -31,11 +31,6 @@ import {
|
||||
import { Suspense } from 'react';
|
||||
import { RouterProvider } from 'react-router-dom';
|
||||
|
||||
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 performanceI18nLogger = performanceLogger.namespace('i18n');
|
||||
const cache = createEmotionCache();
|
||||
|
||||
|
||||
@@ -23,11 +23,11 @@ function main() {
|
||||
performanceMainLogger.info('start');
|
||||
|
||||
// skip bootstrap setup for desktop onboarding
|
||||
if (environment.isElectron && appInfo?.windowName === 'onboarding') {
|
||||
if (BUILD_CONFIG.isElectron && appInfo?.windowName === 'onboarding') {
|
||||
performanceMainLogger.info('skip setup');
|
||||
} else {
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user