Browse Source

fixed a bug where removed spells were not removed from favorites list

Warafear 9 months ago
parent
commit
200861ea97
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/app/journal/journal-spellbook/journal-spellbook.component.ts

+ 2 - 0
src/app/journal/journal-spellbook/journal-spellbook.component.ts

@@ -320,6 +320,7 @@ export class JournalSpellbookComponent {
         if (result.state === 'delete') {
           result.data.forEach((spell: Spell) => {
             this.dataAccessor.deleteCustomSpell(spell);
+            this.dataAccessor.removeFavoriteSpell(spell);
             this.deleteSpellFromPrepared(spell);
           });
           this.refreshFilteredSpells();
@@ -396,6 +397,7 @@ export class JournalSpellbookComponent {
           this.addSpellToPrepared(spell);
         } else if (message.action === 'removeFromPrepared') {
           this.removeSpellFromPrepared(spell);
+          this.dataAccessor.removeFavoriteSpell(spell);
         }
       },
     );