From dc2d502dfa1b119c83e5f1b9c3e0fbb0f494a2c3 Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 23 Oct 2023 16:44:57 +0100 Subject: [PATCH] fetch player data less often --- src/store/scoresaberScoresStore.ts | 2 +- src/store/settingsStore.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/store/scoresaberScoresStore.ts b/src/store/scoresaberScoresStore.ts index 3745629..031de20 100644 --- a/src/store/scoresaberScoresStore.ts +++ b/src/store/scoresaberScoresStore.ts @@ -120,7 +120,7 @@ export const useScoresaberScoresStore = create()( while (search) { page++; const newScores = await ScoreSaberAPI.fetchScores(playerId, page); - console.log("Scanning page", page, "for", playerId); + console.log(`Fetched page ${page} for ${playerId}...`); if (newScores?.scores.length == 0 || newScores == undefined) break; // Call the callback if it exists diff --git a/src/store/settingsStore.ts b/src/store/settingsStore.ts index 64d5c23..4d4ed3f 100644 --- a/src/store/settingsStore.ts +++ b/src/store/settingsStore.ts @@ -26,7 +26,7 @@ interface SettingsStore { getProfile(playerId: string): ScoresaberPlayer | undefined; } -const UPDATE_INTERVAL = 1000 * 60 * 10; // 10 minutes +const UPDATE_INTERVAL = 1000 * 60 * 60; // 1 hour export const useSettingsStore = create()( persist(