Skip to content

Commit

Permalink
fix(inventory,mercantile): inventory/stockpile page will no longer re…
Browse files Browse the repository at this point in the history
…set category when an item leaves
  • Loading branch information
seiyria committed Mar 8, 2023
1 parent 1cd9cb2 commit 61524fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/pages/character/inventory/inventory.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export class InventoryPage implements OnInit, OnDestroy {

ngOnInit() {
this.categorySub = this.inventory$.subscribe(x => {
if(this.activeCategory && this.itemsInCategory(x, this.activeCategory).length > 0) {
return;
}

if (this.hasNoItems(x)) {
this.activeCategory = '';
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ export class StockpilePage implements OnInit, OnDestroy {
this.categorySub = this.stockpile$.subscribe(x => {
const items = x.items;

if(this.activeCategory && this.itemsInCategory(items, this.activeCategory).length > 0) {
return;
}

if (this.hasNoItems(items)) {
this.activeCategory = '';
return;
Expand Down

0 comments on commit 61524fd

Please sign in to comment.