Store/Settings: Rename `webframe` -> `webFrame` and respective import

This fixes an issue in which the user's preferred UI scaling was
being ignored on startup.
This commit is contained in:
Svallinn 2021-06-06 18:16:09 +01:00
parent 0bd75d558f
commit 58bd0d1f36
No known key found for this signature in database
GPG Key ID: 09FB527F34037CCA
1 changed files with 4 additions and 6 deletions

View File

@ -1,7 +1,6 @@
import Datastore from 'nedb'
let dbLocation
let webframe = null
const usingElectron = window?.process?.type === 'renderer'
@ -14,11 +13,9 @@ if (usingElectron) {
dbLocation = electron.remote.app.getPath('userData')
} */
const electron = require('electron')
const ipcRenderer = electron.ipcRenderer
const { ipcRenderer } = require('electron')
dbLocation = ipcRenderer.sendSync('getUserDataPathSync')
dbLocation = dbLocation + '/settings.db'
webframe = electron.webframe
} else {
dbLocation = 'settings.db'
}
@ -225,8 +222,9 @@ Object.assign(actions, {
commit('setBarColor', result.value)
break
case 'uiScale':
if (webframe) {
webframe.setZoomFactor(parseInt(result.value) / 100)
if (usingElectron) {
const { webFrame } = require('electron')
webFrame.setZoomFactor(parseInt(result.value) / 100)
}
commit('setUiScale', result.value)
break