diff --git a/src/global/actions/ui/initial.ts b/src/global/actions/ui/initial.ts index b5e67af1d..befe3d5a9 100644 --- a/src/global/actions/ui/initial.ts +++ b/src/global/actions/ui/initial.ts @@ -4,7 +4,7 @@ import type { LangCode } from '../../../types'; import type { ActionReturnType, GlobalState } from '../../types'; import { requestMutation } from '../../../lib/fasterdom/fasterdom'; -import { IS_MULTIACCOUNT_SUPPORTED, IS_TAURI } from '../../../util/browser/globalEnvironment'; +import { IS_ELECTRON, IS_MULTIACCOUNT_SUPPORTED, IS_TAURI } from '../../../util/browser/globalEnvironment'; import { IS_ANDROID, IS_IOS, IS_LINUX, IS_MAC_OS, IS_SAFARI, IS_TOUCH_ENV, IS_WINDOWS, @@ -174,6 +174,9 @@ addCallback((global: GlobalState) => { if (IS_TAURI) { document.body.classList.add('is-tauri'); } + if (IS_ELECTRON) { // Legacy + document.body.classList.add('is-electron'); + } }); const canAnimate = selectCanAnimateInterface(global); diff --git a/src/styles/index.scss b/src/styles/index.scss index 0f0076b16..2e5d073ba 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -92,7 +92,7 @@ body.is-ios { --border-radius-messages-small: 0.5rem; } -body.is-tauri { +body.is-tauri, body.is-electron { --custom-cursor: default; --window-controls-width: 5rem; } diff --git a/src/util/browser/globalEnvironment.ts b/src/util/browser/globalEnvironment.ts index 0e81aa9f1..fa9cb3e60 100644 --- a/src/util/browser/globalEnvironment.ts +++ b/src/util/browser/globalEnvironment.ts @@ -8,3 +8,5 @@ export const IS_BAD_URL_PARSER = new URL('tg://host').host !== 'host'; export const ARE_WEBCODECS_SUPPORTED = 'VideoDecoder' in globalThis; export const IS_TAURI = isTauri(); +// @ts-expect-error no types for electron +export const IS_ELECTRON = Boolean(globalThis.electron);