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