From 3d95ea6acbd47cabee519b2450647512ac2d5b46 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 8 Mar 2021 21:56:20 +0200 Subject: [PATCH] cleanup + fix --- src/components/settings_modal/settings_modal.js | 1 - src/modules/config.js | 4 ++-- src/services/export_import/export_import.js | 2 -- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/components/settings_modal/settings_modal.js b/src/components/settings_modal/settings_modal.js index 7010e4aa..04043483 100644 --- a/src/components/settings_modal/settings_modal.js +++ b/src/components/settings_modal/settings_modal.js @@ -116,7 +116,6 @@ const SettingsModal = { if (data) { this.$store.dispatch('loadSettings', data) } }, restore () { - console.log(this.dataImporter) this.dataImporter.importData() }, backup () { diff --git a/src/modules/config.js b/src/modules/config.js index 352adf20..b0fc98f5 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -111,7 +111,7 @@ const config = { }, actions: { loadSettings ({ dispatch }, data) { - const knownKeys = new Set(Object.keys(this.state.config)) + const knownKeys = new Set(Object.keys(defaultState)) const presentKeys = new Set(Object.keys(data)) const intersection = new Set() for (let elem of presentKeys) { @@ -120,7 +120,7 @@ const config = { } } - Object.keys(intersection).forEach( + intersection.forEach( name => dispatch('setOption', { name, value: data[name] }) ) }, diff --git a/src/services/export_import/export_import.js b/src/services/export_import/export_import.js index 0bf9eadc..ac67cf9c 100644 --- a/src/services/export_import/export_import.js +++ b/src/services/export_import/export_import.js @@ -26,7 +26,6 @@ export const newImporter = ({ const filePicker = document.createElement('input') filePicker.setAttribute('type', 'file') filePicker.setAttribute('accept', '.json') - console.log(1) filePicker.addEventListener('change', event => { if (event.target.files[0]) { @@ -45,7 +44,6 @@ export const newImporter = ({ onImportFailure({ error }) } } - console.log(2) reader.readAsText(event.target.files[0]) } })