fix(v0.5.3-prep): async storage.onChanged listener (await fix)
Previous commit (60331b8) added `await getQuickStations()` inside
the chrome.storage.onChanged callback, but the callback arrow
function was still synchronous. Node --check missed it (node parses
the file but doesn't fully simulate Chrome's stricter module
analysis); Chrome's parser caught it as 'Unexpected reserved word'
at the await keyword.
One-character fix: `(changes, area) =>` becomes
`async (changes, area) =>`.
Same pattern as the rest of the file (e.g. initThemeUI, the toggle
handlers) which are already async.
This commit is contained in:
@@ -111,7 +111,7 @@ async function init() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Refresh stats live if storage changes from another surface
|
// Refresh stats live if storage changes from another surface
|
||||||
chrome.storage.onChanged.addListener((changes, area) => {
|
chrome.storage.onChanged.addListener(async (changes, area) => {
|
||||||
if (area !== 'local') return;
|
if (area !== 'local') return;
|
||||||
if (changes[THEME_KEY]) {
|
if (changes[THEME_KEY]) {
|
||||||
const v = changes[THEME_KEY].newValue || THEME_DEFAULT;
|
const v = changes[THEME_KEY].newValue || THEME_DEFAULT;
|
||||||
|
|||||||
Reference in New Issue
Block a user