From 890aa277f11a49783f2827743d7c12c7898e140d Mon Sep 17 00:00:00 2001 From: ebolam Date: Thu, 27 Apr 2023 08:43:07 -0400 Subject: [PATCH] Now refreshes the browser when reconnecting to socketio --- static/koboldai.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/static/koboldai.js b/static/koboldai.js index 80156d11..7dfc4a5e 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -80,6 +80,7 @@ var generating_summary = false; const on_colab = $el("#on_colab").textContent == "true"; let story_id = -1; var dirty_chunks = []; +var initial_socketio_connection_occured = false; // Each entry into this array should be an object that looks like: // {class: "class", key: "key", func: callback} @@ -218,6 +219,10 @@ var current_action; function connect() { console.log("connected"); //reset_story(); + if (initial_socketio_connection_occured) { + location.reload(); + } + initial_socketio_connection_occured = true; for (item of document.getElementsByTagName("body")) { item.classList.remove("NotConnected"); }