mirror of
https://github.com/thelounge/thelounge.git
synced 2026-03-14 14:35:50 +01:00
fix: sync across devices for nested settings
This commit is contained in:
parent
5acee92fb2
commit
80db482aac
1 changed files with 7 additions and 6 deletions
|
|
@ -718,16 +718,17 @@ function initializeClient(
|
|||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
typeof newSetting.value === "object" ||
|
||||
typeof newSetting.name !== "string" ||
|
||||
newSetting.name[0] === "_"
|
||||
) {
|
||||
if (typeof newSetting.name !== "string" || newSetting.name[0] === "_") {
|
||||
return;
|
||||
}
|
||||
|
||||
// Allow plain objects for nested settings, but reject arrays and null
|
||||
if (typeof newSetting.value === "object" && !_.isPlainObject(newSetting.value)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// We do not need to do write operations and emit events if nothing changed.
|
||||
if (client.config.clientSettings[newSetting.name] !== newSetting.value) {
|
||||
if (!_.isEqual(client.config.clientSettings[newSetting.name], newSetting.value)) {
|
||||
client.config.clientSettings[newSetting.name] = newSetting.value;
|
||||
|
||||
// Pass the setting to all clients.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue