mirror of
https://github.com/thelounge/thelounge
synced 2024-11-26 22:10:22 +00:00
Merge pull request #3531 from thelounge/xpaw/ignore-unknown-settings
Ignore unknown settings
This commit is contained in:
commit
5f2651a252
1 changed files with 12 additions and 1 deletions
|
@ -37,6 +37,11 @@ export function createSettingsStore(store) {
|
||||||
|
|
||||||
const settingConfig = config[name];
|
const settingConfig = config[name];
|
||||||
|
|
||||||
|
// Trying to update a non existing setting (e.g. server has an old key)
|
||||||
|
if (!settingConfig) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
sync === false &&
|
sync === false &&
|
||||||
(state.syncSettings === false || settingConfig.sync === "never")
|
(state.syncSettings === false || settingConfig.sync === "never")
|
||||||
|
@ -64,7 +69,13 @@ export function createSettingsStore(store) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadFromLocalStorage() {
|
function loadFromLocalStorage() {
|
||||||
const storedSettings = JSON.parse(storage.get("settings")) || false;
|
let storedSettings;
|
||||||
|
|
||||||
|
try {
|
||||||
|
storedSettings = JSON.parse(storage.get("settings"));
|
||||||
|
} catch (e) {
|
||||||
|
storage.remove("settings");
|
||||||
|
}
|
||||||
|
|
||||||
if (!storedSettings) {
|
if (!storedSettings) {
|
||||||
return {};
|
return {};
|
||||||
|
|
Loading…
Reference in a new issue