Update button on redirect change

This commit is contained in:
Kevin Raoofi 2020-10-28 05:12:48 -04:00
parent 7954c29482
commit 2e58a04333
2 changed files with 6 additions and 1 deletions

View file

@ -89,7 +89,7 @@ export const ytService = {
video_ids: groups['video']?.map(s => s.id).join(','),
channel_ids: groups['channel']?.map(s => s.id).join(','),
}));
return fetch(`${LBRY_API_HOST}/yt/resolve?${params}`)
return fetch(`${LBRY_API_HOST}/yt/resolve?${params}`, {cache: 'force-cache'})
.then(rsp => rsp.ok ? rsp.json() : null);
}));

View file

@ -106,3 +106,8 @@ chrome.runtime.onMessage.addListener(async (req: { url: string }) => {
if (!req.url) return;
handle(new URL(req.url));
});
chrome.storage.onChanged.addListener((changes, areaName) => {
if (areaName !== 'local' || !changes.redirect) return;
handle(new URL(location.href))
});