fix archive raid no reserves

This commit is contained in:
peter
2020-02-09 04:16:37 +01:00
parent e0710d722a
commit 8189dadfbf
3 changed files with 15 additions and 6 deletions
@@ -52,7 +52,9 @@ export class FrontcraftArchiveComponent implements OnInit{
const raidManager = this.api.get('RaidManager') const raidManager = this.api.get('RaidManager')
const raiddata = await raidManager.getArchiveRaid(parseInt(param)) const raiddata = await raidManager.getArchiveRaid(parseInt(param))
this.raid = raiddata this.raid = raiddata
this.tokens = raiddata.tokens; this.isTier = raiddata.tier != null
this.tokens = raiddata.tokens
this.displayedtokens = this.tokens;
[ [
...raiddata.tanks, ...raiddata.tanks,
@@ -137,7 +137,7 @@
<nb-card *ngIf="isTier"> <nb-card *ngIf="isTier">
<nb-card-body> <nb-card-body>
<nb-tabset> <nb-tabset>
<nb-tab tabTitle="Reserves"> <nb-tab tabTitle="Reserves" [active]="reservesShown">
<input type="text" nbInput [(ngModel)]="search" (change)="changeSearch()" placeholder="Search" <input type="text" nbInput [(ngModel)]="search" (change)="changeSearch()" placeholder="Search"
fullWidth="true"> fullWidth="true">
@@ -162,7 +162,7 @@
</nb-list-item> </nb-list-item>
</nb-list> </nb-list>
</nb-tab> </nb-tab>
<nb-tab tabTitle="Items" *ngIf="isSignedup"> <nb-tab tabTitle="Items" *ngIf="isSignedup" [active]="!reservesShown">
<shop [tier]="raid.tier" (onSelect)="itemSelect($event)"></shop> <shop [tier]="raid.tier" (onSelect)="itemSelect($event)"></shop>
</nb-tab> </nb-tab>
</nb-tabset> </nb-tabset>
@@ -18,6 +18,7 @@ export class FrontcraftRaidComponent implements OnInit, OnDestroy{
isSignedup = false isSignedup = false
islate = false islate = false
isTier = false isTier = false
reservesShown = true
manageRaid manageRaid
mySignup: (Signup & Character & Spec) mySignup: (Signup & Character & Spec)
@@ -36,7 +37,7 @@ export class FrontcraftRaidComponent implements OnInit, OnDestroy{
tanks: [], tanks: [],
healers: [], healers: [],
tokens:{}, tokens:{},
tier: 'MC' tier: 'null'
} }
tokens = {} tokens = {}
displayedtokens = {} displayedtokens = {}
@@ -79,8 +80,6 @@ export class FrontcraftRaidComponent implements OnInit, OnDestroy{
this.uuid = res.uuid this.uuid = res.uuid
} }
itemSelect = async(item) => { itemSelect = async(item) => {
this.dialogService.open(FrontcraftBuyTokenComponent, { this.dialogService.open(FrontcraftBuyTokenComponent, {
context: { context: {
@@ -89,6 +88,10 @@ export class FrontcraftRaidComponent implements OnInit, OnDestroy{
tier: this.raid.tier, tier: this.raid.tier,
characterName: this.mySignup.charactername characterName: this.mySignup.charactername
} }
}).onClose.subscribe(() => {
this.refresh().then(()=>{
this.reservesShown = true
})
}) })
} }
@@ -102,6 +105,10 @@ export class FrontcraftRaidComponent implements OnInit, OnDestroy{
context: { context: {
raid: this.raid, raid: this.raid,
} }
}).onClose.subscribe(() => {
this.refresh().then(()=>{
this.reservesShown = false
})
}) })
} }