mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-27 19:02:23 +08:00
refactor: migrate environment to BUILD_CONFIG (#8206)
This commit is contained in:
@@ -44,7 +44,7 @@ export const dateFormatOptions: DateFormats[] = [
|
||||
];
|
||||
|
||||
const appSettingBaseAtom = atomWithStorage<AppSetting>('affine-settings', {
|
||||
clientBorder: environment.isElectron && !environment.isWindows,
|
||||
clientBorder: BUILD_CONFIG.isElectron && !environment.isWindows,
|
||||
windowFrameStyle: 'frameless',
|
||||
dateFormat: dateFormatOptions[0],
|
||||
startWeekOnMonday: false,
|
||||
@@ -61,7 +61,7 @@ type SetStateAction<Value> = Value | ((prev: Value) => Value);
|
||||
const appSettingEffect = atomEffect(get => {
|
||||
const settings = get(appSettingBaseAtom);
|
||||
// some values in settings should be synced into electron side
|
||||
if (environment.isElectron) {
|
||||
if (BUILD_CONFIG.isElectron) {
|
||||
logger.debug('sync settings to electron', settings);
|
||||
// this api type in @affine/electron-api, but it is circular dependency this package, use any here
|
||||
(window as any).apis?.updater
|
||||
|
||||
@@ -75,7 +75,7 @@ export function effect<T, A, B, C, D, E, F>(
|
||||
export function effect(...args: any[]) {
|
||||
const subject$ = new Subject<any>();
|
||||
|
||||
const effectLocation = environment.isDebug
|
||||
const effectLocation = BUILD_CONFIG.debug
|
||||
? `(${new Error().stack?.split('\n')[2].trim()})`
|
||||
: '';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { FlagInfo } from './types';
|
||||
|
||||
const isNotStableBuild = BUILD_CONFIG.appBuildType !== 'stable';
|
||||
const isDesktopEnvironment = environment.isElectron;
|
||||
const isDesktopEnvironment = BUILD_CONFIG.isElectron;
|
||||
const isCanaryBuild = BUILD_CONFIG.appBuildType === 'canary';
|
||||
|
||||
export const AFFINE_FLAGS = {
|
||||
|
||||
Reference in New Issue
Block a user