Skip to content

Commit

Permalink
V3 updates for migration path
Browse files Browse the repository at this point in the history
  • Loading branch information
crittermike committed Apr 30, 2024
1 parent 8e0a36c commit 45a89ae
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
15 changes: 13 additions & 2 deletions app/options/options.vue
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,19 @@ export default {
}
};
const savedKeys = await chrome.storage.local.get('keys')
this.keys = [...JSON.parse(savedKeys.keys || '[{}]')]
async function loadKeys() {
const savedKeys = await chrome.storage.local.get('keys');
if (savedKeys.keys) {
this.keys = [...JSON.parse(savedKeys.keys)];
} else {
// Fallback to localStorage if chrome.storage.local has no keys.
// This supports the manifest v2 to v3 migratoin path.
this.keys = localStorage.shortkeys ? JSON.parse(localStorage.shortkeys).keys : [{}];
}
}
loadKeys();
chrome.bookmarks.getTree(processBookmarks)
},
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 45a89ae

Please sign in to comment.