lite fix admin button display issue when preload story

This commit is contained in:
Concedo 2025-03-17 00:17:31 +08:00
parent 6888f5495d
commit 131107dc91

View file

@ -12,7 +12,7 @@ Current version indicated by LITEVER below.
-->
<script>
const LITEVER = 223;
const LITEVER = 224;
const urlParams = new URLSearchParams(window.location.search);
var localflag = true;
const STORAGE_PREFIX = (localflag?"e_":"")+"kaihordewebui_";
@ -9647,20 +9647,18 @@ Current version indicated by LITEVER below.
.then(response => response.json())
.then(values5 => {
let tmpstory = values5;
if(is_kai_json(tmpstory))
{
if (is_kai_json(tmpstory)) {
if (localsettings.persist_session && !safe_to_overwrite()) {
console.log("Preload story: Unsafe to overwrite");
} else {
close_welcome_panel(false);
kai_json_load(tmpstory, false);
}
}else{
if(koboldcpp_has_multiplayer || koboldcpp_admin_type>0)
{
//force refresh
render_gametext(false);
}
}
if(koboldcpp_has_multiplayer || koboldcpp_admin_type>0)
{
//force refresh
render_gametext(false);
}
}).catch(error => {
console.log("Failed to get preloaded story: " + error);