Skip to content
Permalink
Browse files

Fixed new hit catcher settings not being applied on update.

New settings would only work for new installs, not updates.
  • Loading branch information...
Kadauchi committed May 15, 2019
1 parent aae0dcb commit ae0568bd46d2bc12da8f7872f97cdff3b40b46d7
Showing with 50 additions and 44 deletions.
  1. +50 −44 background/background.js
@@ -72,53 +72,59 @@ chrome.storage.local.get(`version`, keys => {
}
});

const hitFinderDefaultSettings = {
speed: `3000`,

"filter-search-term": ``,
"filter-sort": `updated_desc`,
"filter-page-size": `25`,
"filter-masters": false,
"filter-qualified": false,
"filter-min-reward": `0`,
"filter-min-available": `0`,
"filter-min-requester-rating": `0`,

"alert-new-sound": `sound-1`,
"alert-include-delay": `30`,
"alert-include-sound": `voice`,
"alert-pushbullet-state": `off`,
"alert-pushbullet-token": ``,

"display-colored-rows": true,

"display-recent-column-time": false,
"display-recent-column-requester": true,
"display-recent-column-title": true,
"display-recent-column-available": true,
"display-recent-column-reward": true,
"display-recent-column-masters": true,
"display-recent-column-hit-catcher": true,

"display-logged-column-time": true,
"display-logged-column-requester": true,
"display-logged-column-title": true,
"display-logged-column-available": true,
"display-logged-column-reward": true,
"display-logged-column-masters": true,
"display-logged-column-hit-catcher": true,

"display-included-column-time": true,
"display-included-column-requester": true,
"display-included-column-title": true,
"display-included-column-available": true,
"display-included-column-reward": true,
"display-included-column-masters": true,
"display-included-column-hit-catcher": true
};

chrome.storage.local.get(`hitFinder`, keys => {
if (!keys.hitFinder) {
chrome.storage.local.set({
hitFinder: {
speed: `3000`,

"filter-search-term": ``,
"filter-sort": `updated_desc`,
"filter-page-size": `25`,
"filter-masters": false,
"filter-qualified": false,
"filter-min-reward": `0`,
"filter-min-available": `0`,
"filter-min-requester-rating": `0`,

"alert-new-sound": `sound-1`,
"alert-include-delay": `30`,
"alert-include-sound": `voice`,
"alert-pushbullet-state": `off`,
"alert-pushbullet-token": ``,

"display-colored-rows": true,

"display-recent-column-time": false,
"display-recent-column-requester": true,
"display-recent-column-title": true,
"display-recent-column-available": true,
"display-recent-column-reward": true,
"display-recent-column-masters": true,
"display-recent-column-hit-catcher": true,

"display-logged-column-time": true,
"display-logged-column-requester": true,
"display-logged-column-title": true,
"display-logged-column-available": true,
"display-logged-column-reward": true,
"display-logged-column-masters": true,
"display-logged-column-hit-catcher": true,

"display-included-column-time": true,
"display-included-column-requester": true,
"display-included-column-title": true,
"display-included-column-available": true,
"display-included-column-reward": true,
"display-included-column-masters": true,
"display-included-column-hit-catcher": true
}
hitFinder: hitFinderDefaultSettings
});
} else {
chrome.storage.local.set({
hitFinder: { ...hitFinderDefaultSettings, ...keys.hitFinder }
});
}
});

0 comments on commit ae0568b

Please sign in to comment.
You can’t perform that action at this time.