Update to properly retreive stored spells

This commit is contained in:
William Moore 2023-07-01 22:00:11 -05:00
parent b3dbdd3280
commit 12596531a5

View File

@ -8,13 +8,6 @@ export class Place extends LitElement {
@property() getCurrentSpell: any = null;
constructor() {
super();
const storedSpells = JSON.parse(localStorage.getItem(this.location) ?? '[]');
this.spells = storedSpells;
}
static get properties() {
return {
location: {
@ -58,6 +51,9 @@ export class Place extends LitElement {
];
override render() {
const storedSpells = JSON.parse(localStorage.getItem(this.location) ?? '[]');
this.spells = storedSpells;
return html`
<div @click="${this.addSpell}">
<h3>${this.location}</h3>