From c91d23d2a4f03bc80002a84b817d2c7af85595ea Mon Sep 17 00:00:00 2001 From: William Moore Date: Sat, 1 Jul 2023 22:09:21 -0500 Subject: [PATCH] Update to include intro help text --- public/index.html | 28 ++++++++++++++++++++++++++++ src/Place.ts | 8 +++++--- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/public/index.html b/public/index.html index 37409a7..a8fcc64 100644 --- a/public/index.html +++ b/public/index.html @@ -18,6 +18,34 @@ + + + + + diff --git a/src/Place.ts b/src/Place.ts index 6dc5370..90a81ff 100644 --- a/src/Place.ts +++ b/src/Place.ts @@ -21,9 +21,11 @@ export class Place extends LitElement { addSpell() { if (this.getCurrentSpell && typeof this.getCurrentSpell === 'function') { const spell = this.getCurrentSpell(); - this.spells.push(spell); - localStorage.setItem(this.location, JSON.stringify(this.spells)); - this.requestUpdate(); + if (spell) { + this.spells.push(spell); + localStorage.setItem(this.location, JSON.stringify(this.spells)); + this.requestUpdate(); + } } }