persisting zoom setting in electron, fixes #112

This commit is contained in:
azivner
2018-06-02 13:02:20 -04:00
parent 083cccea28
commit 0f8f707acd
8 changed files with 67 additions and 27 deletions

View File

@@ -2,9 +2,10 @@
const sql = require('../../services/sql');
const optionService = require('../../services/options');
const log = require('../../services/log');
// options allowed to be updated directly in options dialog
const ALLOWED_OPTIONS = ['protectedSessionTimeout', 'noteRevisionSnapshotTimeInterval'];
const ALLOWED_OPTIONS = ['protectedSessionTimeout', 'noteRevisionSnapshotTimeInterval', 'zoomFactor'];
async function getOptions() {
const options = await sql.getMap("SELECT name, value FROM options WHERE name IN ("
@@ -20,6 +21,8 @@ async function updateOption(req) {
return [400, "not allowed option to set"];
}
log.info(`Updating option ${name} to ${value}`);
await optionService.setOption(name, value);
}