From f0deb78e6fd0dd2b8bc36b075fc6eddcc6ee5a33 Mon Sep 17 00:00:00 2001 From: Emma Date: Thu, 29 Sep 2022 08:24:10 -0400 Subject: [PATCH] Hiding "Disable smooth scroll" option in web (#2638) * Hiding "smooth-scroll" setting when not electron - This feature requires the restart of electron and doesn't work in web builds. * Removing this comment - A safeguard was added - This function won't be called unless IS_ELECTRON is true --- src/renderer/components/theme-settings/theme-settings.js | 5 +++-- src/renderer/components/theme-settings/theme-settings.vue | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/theme-settings/theme-settings.js b/src/renderer/components/theme-settings/theme-settings.js index a3a4c910..8098ae2f 100644 --- a/src/renderer/components/theme-settings/theme-settings.js +++ b/src/renderer/components/theme-settings/theme-settings.js @@ -109,6 +109,9 @@ export default Vue.extend({ const colorName = colorVal.replace(/([A-Z])/g, ' $1').trim() return this.$t(`Settings.Theme Settings.Main Color Theme.${colorName}`) }) + }, + usingElectron: function () { + return process.env.IS_ELECTRON } }, mounted: function () { @@ -139,9 +142,7 @@ export default Vue.extend({ this.updateDisableSmoothScrolling( this.disableSmoothScrollingToggleValue ).then(() => { - // FIXME: No electron safeguard const { ipcRenderer } = require('electron') - ipcRenderer.send('relaunchRequest') }) }, diff --git a/src/renderer/components/theme-settings/theme-settings.vue b/src/renderer/components/theme-settings/theme-settings.vue index 5abf8706..2904c1d9 100644 --- a/src/renderer/components/theme-settings/theme-settings.vue +++ b/src/renderer/components/theme-settings/theme-settings.vue @@ -14,6 +14,7 @@ @change="handleExpandSideBar" />