Enable sync on empty localstorage

This commit is contained in:
creesch 2018-03-30 09:46:59 +02:00
parent e967859d5f
commit 107749e91a

View File

@ -49,13 +49,18 @@ const noSync = ["syncSettings"];
const alwaysSync = [];
// Process usersettings from localstorage.
let userSettings = JSON.parse(storage.get("settings")) || {};
let userSettings = JSON.parse(storage.get("settings")) || false;
if (!userSettings) {
// Enable sync by default if there are no user defined settings.
settings.syncSettings = true;
} else {
for (const key in settings) {
if (userSettings[key] !== undefined) {
settings[key] = userSettings[key];
}
}
}
// Apply custom CSS and themes on page load
// Done here and not on init because on slower devices and connections