Enable sync on empty localstorage
This commit is contained in:
parent
e967859d5f
commit
107749e91a
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user