fix(browser-extension): issues fetch every popup open

This commit is contained in:
wanhose 2024-10-15 16:29:40 +02:00
parent 263d827259
commit 7d611b5ea2

View File

@ -229,7 +229,7 @@ async function refreshData(attempt = 1) {
async function refreshIssue(hostname, attempt = 1) { async function refreshIssue(hostname, attempt = 1) {
if (attempt <= 3) { if (attempt <= 3) {
try { try {
const { data } = await requestManager.fetch(`${apiUrl}/issues/${hostname}/`); const { data = {} } = await requestManager.fetch(`${apiUrl}/issues/${hostname}/`);
if (Object.keys(data).length === 0) { if (Object.keys(data).length === 0) {
await updateStore(hostname, { issue: { expiresIn: Date.now() + 8 * 60 * 60 * 1000 } }); await updateStore(hostname, { issue: { expiresIn: Date.now() + 8 * 60 * 60 * 1000 } });