Skip to content

Commit

Permalink
Add leaderboard sync button
Browse files Browse the repository at this point in the history
  • Loading branch information
Umbranoxio committed Dec 15, 2023
1 parent 156a023 commit df4cf30
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/routes/leaderboard/[leaderboardId].svelte
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,13 @@
refreshLeaderboard({ forceRevalidate: true, softRefresh: true });
}
async function handleSyncLeaderboard() {
const leaderboardId = $leaderboard.id;
leaderboard.set(undefined);
await poster('/api/ranking/request/action/admin/refresh', { leaderboardId }, { withCredentials: true });
refreshLeaderboard({ forceRevalidate: true, softRefresh: true });
}
async function handleRankLeaderboard() {
const leaderboardId = $leaderboard.id;
leaderboard.set(undefined);
Expand Down Expand Up @@ -332,6 +339,13 @@ Stars: ${metadata.stars}★`}
</span>
</button>
</p>
<p class="control ml-0">
<button on:click={() => handleSyncLeaderboard()} class="button is-small is-success">
<span class="icon is-small">
<i class="fas fa-sync-alt" />
</span>
</button>
</p>
<p class="control ml-1">
<button on:click={() => handleUnrankLeaderboard()} class="button is-small is-danger"> Unrank </button>
</p>
Expand Down

0 comments on commit df4cf30

Please sign in to comment.