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:
Pavel Djundik 2017-08-16 11:09:22 +03:00 committed by GitHub
commit e6200f1461

View File

@ -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) {