diff --git a/src/renderer/components/theme-settings/theme-settings.js b/src/renderer/components/theme-settings/theme-settings.js index 6b12ec76..45e01f5f 100644 --- a/src/renderer/components/theme-settings/theme-settings.js +++ b/src/renderer/components/theme-settings/theme-settings.js @@ -145,14 +145,6 @@ export default Vue.extend({ localStorage.setItem('expandSideBar', value) }, - handleUiScale: function (value) { - // FIXME: No electron safeguard - const { webFrame } = require('electron') - const zoomFactor = value / 100 - webFrame.setZoomFactor(zoomFactor) - this.updateUiScale(parseInt(value)) - }, - handleRestartPrompt: function (value) { this.disableSmoothScrollingToggleValue = value this.showRestartPrompt = true diff --git a/src/renderer/components/theme-settings/theme-settings.vue b/src/renderer/components/theme-settings/theme-settings.vue index 078056e4..1e7fde7e 100644 --- a/src/renderer/components/theme-settings/theme-settings.vue +++ b/src/renderer/components/theme-settings/theme-settings.vue @@ -30,7 +30,7 @@ :max-value="maxUiScale" :step="uiScaleStep" value-extension="%" - @change="handleUiScale" + @change="updateUiScale(parseInt($event))" />
diff --git a/src/renderer/store/modules/settings.js b/src/renderer/store/modules/settings.js index 049d6bd7..12fc7612 100644 --- a/src/renderer/store/modules/settings.js +++ b/src/renderer/store/modules/settings.js @@ -159,7 +159,6 @@ const defaultSideEffectsTriggerId = settingId => const state = { currentTheme: 'lightRed', - uiScale: 100, backendFallback: true, checkForUpdates: true, checkForBlogPosts: true, @@ -214,12 +213,15 @@ const state = { } const stateWithSideEffects = { - /* - setting: { - defaultValue: any, - sideEffectsHandler: (store, settingValue) => void + uiScale: { + defaultValue: 100, + sideEffectsHandler: ({ state: { usingElectron } }, value) => { + if (usingElectron) { + const { webFrame } = require('electron') + webFrame.setZoomFactor(value / 100) + } + } } - */ } const customState = {