Skip to content

Commit

Permalink
Update leaderboard Invite to Play in game fooball
Browse files Browse the repository at this point in the history
  • Loading branch information
anhnhu committed Jul 24, 2024
1 parent 612d8f7 commit 60c44b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@ const Component = ({ className }: Props): React.ReactElement => {
return baseItems.map((item) => {
const { end: endDate, start: startDate } = calculateStartAndEnd(item.value);
let type = 'all';
let gameId = 0;

if (item.value === TabType.INVITE_TO_PLAY){
type = 'inviteToPlay';
gameId = 5;
}

return {
Expand All @@ -120,7 +122,8 @@ const Component = ({ className }: Props): React.ReactElement => {
...item.leaderboardInfo,
startDate,
endDate,
type
type,
gameId
}
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export type LeaderboardTabGroupItemType = TabGroupItemType & {
startDate?: string;
endDate?: string;
type?: string;
gameId?: number;
}
}

Expand Down Expand Up @@ -83,7 +84,7 @@ const Component = ({ className, defaultSelectedTab, gameId, tabGroupItems }: Pro
leaderboardSub = apiSDK.subscribeLeaderboard(
currentTabInfo.leaderboardInfo.startDate,
currentTabInfo.leaderboardInfo.endDate,
gameId || 0, 100,
gameId || currentTabInfo.leaderboardInfo.gameId || 0, 100,
currentTabInfo.leaderboardInfo.type).subscribe((data) => {
setLeaderboardItems(data);
});
Expand Down

0 comments on commit 60c44b7

Please sign in to comment.