Fix online status checks

This commit is contained in:
SillyLossy
2023-03-23 11:53:39 +02:00
parent a46e7a30bd
commit 1b7632c352

View File

@ -49,7 +49,9 @@ const observerConfig = { childList: true, subtree: true };
const observer = new MutationObserver(function (mutations) { const observer = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) { mutations.forEach(function (mutation) {
if (mutation.target.id === "online_status_text2") { if (mutation.target.id === "online_status_text2" ||
mutation.target.id === "online_status_text3" ||
mutation.target.classList.contains("online_status_text4")) {
RA_checkOnlineStatus(); RA_checkOnlineStatus();
} else if (mutation.target.parentNode === SelectedCharacterTab) { } else if (mutation.target.parentNode === SelectedCharacterTab) {
setTimeout(RA_CountCharTokens, 200); setTimeout(RA_CountCharTokens, 200);
@ -260,7 +262,8 @@ function isUrlOrAPIKey(string) {
} }
$("document").ready(function () { $("document").ready(function () {
// initial status check
setTimeout(RA_checkOnlineStatus, 100);
// read the state of AutoConnect and AutoLoadChat. // read the state of AutoConnect and AutoLoadChat.
$(AutoConnectCheckbox).prop("checked", LoadLocalBool("AutoConnectEnabled")); $(AutoConnectCheckbox).prop("checked", LoadLocalBool("AutoConnectEnabled"));