From f13bccf7a9a68888ed04755f5caf61facd0a6370 Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Wed, 20 Sep 2023 21:20:27 +0200 Subject: [PATCH] Fix two bugs in state.js --- state.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/state.js b/state.js index 979fc6c..891e4d0 100644 --- a/state.js +++ b/state.js @@ -6,7 +6,7 @@ export class ChangeEvent extends Event { } get final() { if (!this.#final) { - this.#final = new Map(changes) + this.#final = new Map(this.changes) } return this.#final } @@ -115,8 +115,8 @@ export class StoredState extends State { // Initialise storage from defaults for (let [prop, value] of Object.entries(init)) { - if (prop === this.#valueKey) prop = 'value' - if (this.#storage[prop] == undefined) + if (prop === 'value') prop = this.#valueKey + if (this.#storage[prop] === undefined) this.set(prop, value) }