Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(collections): Fix off-by-one error in portrait display, closes #154 #165

Merged
merged 1 commit into from
Sep 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class ChooseAvatarModalComponent implements OnInit {
ngOnInit() {
this.userService.getDiscoveries().subscribe(({ discoveries }: any) => {
const portraits = discoveries.portraits || {};
this.selectablePortraits = Object.keys(portraits).map((x) => +x);
this.selectablePortraits = Object.keys(portraits).map((x) => +x + 1);
});

this.selectedPortrait = this.defaultPortrait + 1;
Expand Down
6 changes: 4 additions & 2 deletions client/src/app/pages/collections/collections.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,9 @@
class="collect-col"
*ngFor="let portrait of allPortraits; trackBy: trackBy"
>
<ion-avatar [class.uncollected]="!discoveries.portraits?.[portrait]">
<ion-avatar
[class.uncollected]="!discoveries.portraits?.[portrait - 1]"
>
<app-icon spritesheet="portraits" [sprite]="portrait"></app-icon>
</ion-avatar>
</ion-col>
Expand Down Expand Up @@ -553,7 +555,7 @@
*ngFor="let background of allBackgrounds; trackBy: trackBy"
>
<app-background-art
[class.uncollected]="!discoveries.backgrounds?.[background]"
[class.uncollected]="!discoveries.backgrounds?.[background - 1]"
[sprite]="background.toString().padStart(4, '0')"
></app-background-art>
</ion-col>
Expand Down
Loading