Skip to content

Commit

Permalink
feat: sort group member list
Browse files Browse the repository at this point in the history
  • Loading branch information
Dragonisser committed Jun 22, 2022
1 parent 41310cb commit 46e9bcb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Code/skyrim_ui/src/app/components/group/group.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ export class GroupComponent implements OnInit, OnDestroy {
}

public get groupMembers(): Array<Player> {
return this.groupService.getMembers();
let members = this.groupService.getMembers();
return members.sort((a, b) => (this.isOwner(a.id) === this.isOwner(b.id)) ? 0 : this.isOwner(a.id)? -1 : 1);
}

public get getOwner(): Player {
Expand Down
4 changes: 2 additions & 2 deletions Code/skyrim_ui/src/app/components/root/root.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,15 @@ export class RootComponent implements OnInit, OnDestroy {
this.client.isLoadedChange.next(new Player(
{
id: 2,
isLoaded: false,
isLoaded: true,
health: 75
}
));

this.client.partyInfoChange.next(new PartyInfo(
{
playerIds: [1,2],
leaderId: 1
leaderId: 2
}
));
this.client.localPlayerId = 0;
Expand Down

0 comments on commit 46e9bcb

Please sign in to comment.