Files
Folo/packages/internal/shared/src/constants.ts
T
DIYgod 341fd63bf5 fix(desktop): microsoft store build check
- Introduce MICROSOFT_STORE_BUILD constant to determine if the app is running from the Microsoft Store
- Update appUpdaterConfig to conditionally enable core updates based on the new constant
- Modify header creation logic to use MICROSOFT_STORE_BUILD for Windows platform detection

This change enhances the application's compatibility with Microsoft Store by ensuring proper update handling and header configuration.
2025-07-16 18:11:36 +08:00

46 lines
1.2 KiB
TypeScript

import type { ElectronAPI } from "@electron-toolkit/preload"
declare const globalThis: {
window: Window & {
electron?: ElectronAPI
api?: { canWindowBlur: boolean }
}
electron?: ElectronAPI
}
export enum ModeEnum {
development = "development",
staging = "staging",
production = "production",
}
export const MODE = import.meta.env?.MODE as ModeEnum
export const { PROD } = import.meta.env ?? {}
export const DEV =
"process" in globalThis ? process.env.NODE_ENV === "development" : import.meta.env.DEV
export const LEGACY_APP_PROTOCOL = DEV ? "follow-dev" : "follow"
export const APP_PROTOCOL = DEV ? "folo-dev" : "folo"
export const DEEPLINK_SCHEME = `${APP_PROTOCOL}://` as const
export const SYSTEM_CAN_UNDER_BLUR_WINDOW = globalThis?.window?.electron
? globalThis?.window.api?.canWindowBlur
: false
export const IN_ELECTRON = !!globalThis["electron"]
declare const ELECTRON: boolean
/**
* Current build type for electron
*/
export const ELECTRON_BUILD = !!ELECTRON
export const WEB_BUILD = !ELECTRON
export const MICROSOFT_STORE_BUILD =
typeof process !== "undefined"
? process.platform === "win32" &&
(process.windowsStore || process.execPath.startsWith("C:\\Program Files\\WindowsApps"))
: false