Skip to content

Commit 3278d16

Browse files
committed
fix(leaderboard): skip update if user is in top entries
Prevent unnecessary leaderboard updates when the user is already present in the top entries or not authenticated. This avoids redundant processing and improves performance for authenticated users in the leaderboard.
1 parent 3a3108d commit 3278d16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/controllers/leaderboard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default class LeaderboardController extends Controller {
5858
filter_type: 'top',
5959
})) as unknown as LeaderboardEntryModel[];
6060

61-
if (!this.authenticator.isAuthenticated) {
61+
if (!this.authenticator.isAuthenticated || this.userIsInTopLeaderboardEntries) {
6262
return;
6363
}
6464

0 commit comments

Comments
 (0)