From c78efbc274fc04e37dab68aa60b7cb41965122bc Mon Sep 17 00:00:00 2001 From: PaulPlay <80539587+therealPaulPlay@users.noreply.github.com> Date: Sun, 26 Jan 2025 00:28:16 +0100 Subject: [PATCH] Fix: Creating room with optional initial storage did not trigger storage update event --- package.json | 2 +- src/index.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 9e29eb3..1278b63 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "playpeerjs", - "version": "1.1.2", + "version": "1.1.3", "description": "WebRTC-based wrapper for creating robust peer-2-peer multiplayer systems with ease.", "type": "module", "main": "dist/playpeer.js", diff --git a/src/index.js b/src/index.js index fd82f87..f5141b5 100644 --- a/src/index.js +++ b/src/index.js @@ -264,6 +264,7 @@ export default class PlayPeer { return new Promise((resolve) => { this.#isHost = true; this.#storage = initialStorage; + this.#triggerEvent("storageUpdate", { ...this.#storage }); this.#triggerEvent("status", "Room created."); resolve(this.id); });