Skip to content

Commit

Permalink
Add price refresh interval
Browse files Browse the repository at this point in the history
  • Loading branch information
GODrums committed Oct 21, 2024
1 parent 77551c8 commit 33f1942
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/contents/csfloat_script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,15 @@ async function firstLaunch() {
: POPOUT_ITEM.SIMILAR;
await adjustItem(items[i], popoutVersion);
}

// refresh prices every hour
setInterval(
async () => {
console.log('[BetterFloat] Refreshing prices (hourly) ...');
await initPriceMapping(extensionSettings, 'csf');
},
1000 * 60 * 61
);
}

function offerItemClickListener(listItem: Element) {
Expand Down
9 changes: 9 additions & 0 deletions src/contents/skinport_script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,15 @@ async function firstLaunch() {
await adjustItem(item);
}
}

// refresh prices every hour
setInterval(
async () => {
console.log('[BetterFloat] Refreshing prices (hourly) ...');
await initPriceMapping(extensionSettings, 'sp');
},
1000 * 60 * 61
);
}

function createLanguagePopup() {
Expand Down

0 comments on commit 33f1942

Please sign in to comment.