Merge pull request #1421 from thelounge/yamanickill/1420-user-options-falsey
Fix issue with falsey user options getting overridden by truthy defaults
This commit is contained in:
commit
e6200f1461
@ -25,14 +25,16 @@ const options = {
|
||||
thumbnails: true,
|
||||
userStyles: userStyles.text(),
|
||||
};
|
||||
const userOptions = JSON.parse(storage.get("settings")) || {};
|
||||
let userOptions = JSON.parse(storage.get("settings")) || {};
|
||||
|
||||
for (const key in options) {
|
||||
if (userOptions[key]) {
|
||||
if (userOptions[key] !== undefined) {
|
||||
options[key] = userOptions[key];
|
||||
}
|
||||
}
|
||||
|
||||
userOptions = null;
|
||||
|
||||
module.exports = options;
|
||||
|
||||
module.exports.shouldOpenMessagePreview = function(type) {
|
||||
|
Loading…
Reference in New Issue
Block a user