fix: don't show domina mode on snap and for firefox #2977

This commit is contained in:
Johannes Millan 2024-01-12 12:47:49 +01:00
parent eb2cfbff93
commit 2e30b8bc74
4 changed files with 8 additions and 6 deletions

View file

@ -1,4 +1,4 @@
import { IpcRendererEvent, OpenExternalOptions } from 'electron';
import { IpcRendererEvent } from 'electron';
import {
GlobalConfigState,
TakeABreakConfig,
@ -50,6 +50,8 @@ export interface ElectronAPI {
isMacOS(): boolean;
isSnap(): boolean;
// SEND
// ----
reloadMainWin(): void;

View file

@ -43,6 +43,7 @@ const ea: ElectronAPI = {
},
getZoomFactor: () => webFrame.getZoomFactor(),
isMacOS: () => process.platform === 'darwin',
isSnap: () => process && process.env && !!process.env.SNAP,
// SEND
// ----

View file

@ -15,8 +15,8 @@ import { IS_ELECTRON } from '../../app.constants';
import { IS_ANDROID_WEB_VIEW } from '../../util/is-android-web-view';
import { TIMELINE_FORM_CFG } from './form-cfgs/timeline-form.const';
import { DOMINA_MODE_FORM } from './form-cfgs/domina-mode-form.const';
import { isSnap } from '../../util/is-snap';
import { FOCUS_MODE_FORM_CFG } from './form-cfgs/focus-mode-form.const';
import { IS_FIREFOX } from '../../util/is-firefox';
export const GLOBAL_CONFIG_FORM_CONFIG: ConfigFormConfig = [
LANGUAGE_SELECTION_FORM_FORM as GenericConfigFormSection,
@ -40,5 +40,7 @@ export const GLOBAL_PRODUCTIVITY_FORM_CONFIG: ConfigFormConfig = [
POMODORO_FORM_CFG as GenericConfigFormSection,
EVALUATION_SETTINGS_FORM_CFG as GenericConfigFormSection,
SIMPLE_COUNTER_FORM as GenericConfigFormSection,
...(!IS_ELECTRON || !isSnap() ? [DOMINA_MODE_FORM as GenericConfigFormSection] : []),
...(!window.ea?.isSnap() && !IS_FIREFOX
? [DOMINA_MODE_FORM as GenericConfigFormSection]
: []),
].filter((cfg) => IS_ELECTRON || !cfg.isElectronOnly);

View file

@ -1,3 +0,0 @@
export const isSnap = (): boolean => {
return window && window.process && window.process.env && !!window.process.env.SNAP;
};