Skip to content

Commit

Permalink
fix(sprite): no more -1git statusgit status!
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyria committed Sep 12, 2023
1 parent ff4ac76 commit 719e021
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion client/src/app/components/avatar/avatar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
[style.padding.px]="padding"
>
<ion-avatar>
<app-icon spritesheet="portraits" [sprite]="avatar + 1"></app-icon>
<app-icon spritesheet="portraits" [sprite]="avatar"></app-icon>
</ion-avatar>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ export class ChooseAvatarModalComponent implements OnInit {
ngOnInit() {
this.userService.getDiscoveries().subscribe(({ discoveries }: any) => {
const portraits = discoveries.portraits || {};
this.selectablePortraits = Object.keys(portraits).map((x) => +x + 1);
this.selectablePortraits = Object.keys(portraits).map((x) => +x);
});

this.selectedPortrait = this.defaultPortrait + 1;
this.selectedPortrait = this.defaultPortrait;
}

selectPortrait(portrait: number) {
Expand All @@ -43,6 +43,6 @@ export class ChooseAvatarModalComponent implements OnInit {
return;
}

this.modalCtrl.dismiss(this.selectedPortrait - 1);
this.modalCtrl.dismiss(this.selectedPortrait);
}
}
4 changes: 1 addition & 3 deletions client/src/app/pages/collections/collections.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -537,9 +537,7 @@
class="collect-col"
*ngFor="let portrait of allPortraits; trackBy: trackBy"
>
<ion-avatar
[class.uncollected]="!discoveries.portraits?.[portrait - 1]"
>
<ion-avatar [class.uncollected]="!discoveries.portraits?.[portrait]">
<app-icon spritesheet="portraits" [sprite]="portrait"></app-icon>
</ion-avatar>
</ion-col>
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/pages/collections/collections.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class CollectionsPage {

public readonly allPortraits = Array(this.contentService.maxPortraits)
.fill(0)
.map((_, i) => i + 1);
.map((_, i) => i);

public readonly allBackgrounds = Array(this.contentService.maxBackgrounds)
.fill(0)
Expand Down

0 comments on commit 719e021

Please sign in to comment.