Skip to content

Commit

Permalink
🐛 Fixed chrome storage getting cleared on extension update
Browse files Browse the repository at this point in the history
  • Loading branch information
prateek3255 committed Mar 22, 2020
1 parent 1d38d71 commit 8544f48
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ function getUrlWithoutHash(url) {
return url.split("?")[0];
}

chrome.runtime.onInstalled.addListener(() => {
chrome.storage.local.set({ "scroll-mark": {} });
chrome.runtime.onInstalled.addListener(details => {
if (details.reason === "install") {
chrome.storage.local.set({ "scroll-mark": {} });
}
});

const updateIcon = () => {
Expand Down

0 comments on commit 8544f48

Please sign in to comment.