Skip to content

Commit

Permalink
Updated data model to count total players for user
Browse files Browse the repository at this point in the history
  • Loading branch information
eightants committed Aug 18, 2021
1 parent b344ed8 commit 4ab51f1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
20 changes: 13 additions & 7 deletions application/src/app/components/profile/profile.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,25 +159,31 @@ <h3>The Organiser</h3>
</div>
</div>
</div>
<!--<div class="profile-badges">
<div class="profile-badges">
<img
class="profile-badge-icon"
src="{{
PLAYERS_KEY[getAchievedBadge(totalPlayers, PLAYERS_KEY).toString()]
PLAYERS_KEY[
getAchievedBadge(
totalPlayers + pastPlayers,
PLAYERS_KEY
).toString()
]
}}"
/>
<div>
<h3>Popular</h3>
<p>
Get {{ getAchievedBadge(totalPlayers, PLAYERS_KEY) }} friends to
play your challenges.
Get
{{ getAchievedBadge(totalPlayers + pastPlayers, PLAYERS_KEY) }}
friends to play your challenges.
</p>
<div *ngIf="displayProfile">
Next Badge: {{ totalPlayers }} /
{{ getNextBadge(totalPlayers, PLAYERS_KEY) }}
Next Badge: {{ totalPlayers + pastPlayers }} /
{{ getNextBadge(totalPlayers + pastPlayers, PLAYERS_KEY) }}
</div>
</div>
</div>-->
</div>
</div>
<div
*ngIf="!isLoading && currTab == 'challenge'"
Expand Down
8 changes: 5 additions & 3 deletions application/src/app/components/profile/profile.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export class ProfileComponent implements OnInit {
user: any;
isLoading = true;
totalPlayers = 0;
pastPlayers = 0;
selectedChallenge: string;
displayProfile = false;

Expand All @@ -72,10 +73,10 @@ export class ProfileComponent implements OnInit {
if (usernameParam) {
this.username = usernameParam;

this.titleTagService.setTitle(`${this.username} - Whisperify`);
this.titleTagService.setTitle('View User - Whisperify');
this.titleTagService.setSocialMediaTags(
`${this.username} - Whisperify`,
`User quiz statistics and created challenges for ${this.username} on Whisperify.`
'View User - Whisperify',
'User quiz statistics and created challenges. '
);
} else {
this.username = sessionStorage.getItem('username') || '';
Expand All @@ -95,6 +96,7 @@ export class ProfileComponent implements OnInit {
this.isLoading = false;
this.user = res;
this.displayname = res.name;
this.pastPlayers = res.challengePlayers || 0;
});
}
}
Expand Down

0 comments on commit 4ab51f1

Please sign in to comment.