diff --git a/Nibriboard/ClientFiles/RippleLink.js b/Nibriboard/ClientFiles/RippleLink.js index adced9b..a06c845 100644 --- a/Nibriboard/ClientFiles/RippleLink.js +++ b/Nibriboard/ClientFiles/RippleLink.js @@ -23,7 +23,8 @@ class RippleLink extends EventEmitter // Attach some event listeners this.websocket.addEventListener("open", this.handleConnection.bind(this)); this.websocket.addEventListener("message", this.handleMessage.bind(this)); - this.websocket.addEventListener("close", this.handleDisconnection.bind(this)); + let closeHandler = this.handleDisconnection.bind(this); + this.websocket.addEventListener("close", closeHandler); // Respond to heartbeats from the server this.on("Heartbeat", this.handleHeartbeat.bind(this)); @@ -31,6 +32,8 @@ class RippleLink extends EventEmitter // Close the socket correctly window.addEventListener("beforeunload", (function(event) { + // Remove the event listener to avoid issues on refresh + this.websocket.removeEventListener("close", closeHandler); this.websocket.close(); }).bind(this)); } diff --git a/Nibriboard/RippleSpace/Chunk.cs b/Nibriboard/RippleSpace/Chunk.cs index 261d9e9..66b80b7 100644 --- a/Nibriboard/RippleSpace/Chunk.cs +++ b/Nibriboard/RippleSpace/Chunk.cs @@ -91,7 +91,7 @@ namespace Nibriboard.RippleSpace public DateTime TimeLastAccessed { get; private set; } = DateTime.Now; /// - /// Whether this is primary chunk. + /// Whether this is a primary chunk. /// Primary chunks are always loaded. /// [JsonProperty]