Skip to content

Commit

Permalink
change default colour sync
Browse files Browse the repository at this point in the history
  • Loading branch information
mrspeaker committed May 25, 2017
1 parent f2997d9 commit 1bb04d8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions options.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function saveOptions(e) {
e.preventDefault();

const colours = Object.keys(Settings.defaults.colours)
.map(id => ([id, $(`#${id}`).value]))
.map(id => [id, $(`#${id}`).value])
.reduce((o, [key, val]) => {
o[key] = val;
return o;
Expand All @@ -30,14 +30,11 @@ function saveOptions(e) {
}

function restoreOptions() {
Object.entries(Settings.defaults.colours)
.forEach(([key, val]) => $(`#${key}`).value = val);
Settings.fetch().then(res => {
$("#refresh").value = res.refreshTime || 60;
if (res.colours) {
Object.entries(res.colours)
.forEach(([key, val]) => $(`#${key}`).value = val);
}
const colours = res.colours || Settings.defaults.colours || {};
Object.entries(colours)
.forEach(([key, val]) => $(`#${key}`).value = val);
});
}

Expand Down

0 comments on commit 1bb04d8

Please sign in to comment.