- 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.
46 lines
1.2 KiB
TypeScript
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
|