Chat: Add button for manual reloading

If automatic reloading doesn't work. Add this button to manually
reload the chat window. Only reload if a character chat is loaded.

Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
kingbri
2023-06-10 14:33:36 -04:00
parent 424ed9c1df
commit 75814dd50a
2 changed files with 11 additions and 0 deletions

View File

@@ -2106,6 +2106,9 @@
</a> </a>
</label> </label>
</div> </div>
<div id="reload_chat" class="menu_button whitespacenowrap" data-i18n="Reload Chat">
Reload Chat</div>
</div> </div>
<div name="NameAndAvatar" class="flex-container flexFlowColumn drawer25pWidth"> <div name="NameAndAvatar" class="flex-container flexFlowColumn drawer25pWidth">

View File

@@ -11,6 +11,7 @@ import {
updateVisibleDivs, updateVisibleDivs,
eventSource, eventSource,
event_types, event_types,
getCurrentChatId,
} from "../script.js"; } from "../script.js";
import { favsToHotswap } from "./RossAscends-mods.js"; import { favsToHotswap } from "./RossAscends-mods.js";
import { import {
@@ -1156,6 +1157,13 @@ $(document).ready(() => {
saveSettingsDebounced(); saveSettingsDebounced();
}); });
$("#reload_chat").on('click', function () {
const currentChatId = getCurrentChatId();
if (currentChatId !== undefined && currentChatId !== null) {
reloadCurrentChat();
}
});
$("#allow_name1_display").on("input", function () { $("#allow_name1_display").on("input", function () {
power_user.allow_name1_display = !!$(this).prop('checked'); power_user.allow_name1_display = !!$(this).prop('checked');
reloadCurrentChat(); reloadCurrentChat();