|
@@ -162,6 +162,9 @@ export class JournalSpellcardsComponent {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Opens the modal to manage custom spells. Here, custom spells can be deleted.
|
|
|
+ */
|
|
|
public openManageCustomSpellsModal(): void {
|
|
|
this.modalAccessor.openModal(CustomSpellsModalComponent, {
|
|
|
spells: this.dataAccessor.customSpells,
|
|
@@ -187,16 +190,10 @@ export class JournalSpellcardsComponent {
|
|
|
* @param spell
|
|
|
*/
|
|
|
public deleteCustomSpell(spell: Spell): void {
|
|
|
- console.log(spell);
|
|
|
this.dataAccessor.deleteCustomSpell(spell);
|
|
|
this.spellsService.deleteCustomSpell(spell);
|
|
|
-
|
|
|
let list = this.getSpellList(spell.level);
|
|
|
const index = list.findIndex((spellList) => spellList.id === spell.id);
|
|
|
- // const index = list.indexOf(spell);
|
|
|
- console.log('liste: ', list);
|
|
|
- console.log('Index of the spell to delete: ', index);
|
|
|
-
|
|
|
if (index > -1) {
|
|
|
list.splice(index, 1);
|
|
|
this.dataAccessor.removeFavoriteSpell(spell);
|