This commit is contained in:
Joe Jarvis 2017-02-08 17:51:07 -05:00
parent dd9c9420d1
commit 6b559ca64e
2 changed files with 3 additions and 2 deletions

View file

@ -1,7 +1,8 @@
browser.idle.onStateChanged.addListener(function(state) { browser.idle.onStateChanged.addListener(function(state) {
if (state == 'idle') { if (state == 'idle') {
browser.storage.local.get('days', function(res) { browser.storage.local.get('days', function(res) {
if (res.days != 0) { var days = res.days || 0;
if (days != 0) {
var end = new Date(); var end = new Date();
end.setHours(0); end.setHours(0);
end.setMinutes(0); end.setMinutes(0);

View file

@ -4,7 +4,7 @@ function saveOptions(e) {
} }
function restoreOptions() { function restoreOptions() {
browser.storage.local.get('days', function(res) { browser.storage.local.get('days', function(res) {
document.querySelector("#days").value = res.days || '0'; document.querySelector("#days").value = res.days || 0;
}); });
} }
document.addEventListener('DOMContentLoaded', restoreOptions); document.addEventListener('DOMContentLoaded', restoreOptions);