diff --git a/src/Place.ts b/src/Place.ts index dae8a87..6dc5370 100644 --- a/src/Place.ts +++ b/src/Place.ts @@ -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,13 +51,16 @@ export class Place extends LitElement { ]; override render() { + const storedSpells = JSON.parse(localStorage.getItem(this.location) ?? '[]'); + this.spells = storedSpells; + return html` -
-

${this.location}

-
- ${this.spells.sort(spellSort).map(spell => spell ? html`` : '')} +
+

${this.location}

+
+ ${this.spells.sort(spellSort).map(spell => spell ? html`` : '')} +
-
`; } }