mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Offline Downloader Fix
This commit is contained in:
@@ -2371,12 +2371,18 @@ function process_log_message(full_data) {
|
|||||||
//--------------------------------------------UI to Server Functions----------------------------------
|
//--------------------------------------------UI to Server Functions----------------------------------
|
||||||
async function download_story_to_json() {
|
async function download_story_to_json() {
|
||||||
//document.getElementById('download_iframe').src = 'json';
|
//document.getElementById('download_iframe').src = 'json';
|
||||||
try {
|
downloaded = false;
|
||||||
let r = await fetch("json");
|
if (socket.connected) {
|
||||||
let j = await r.json();
|
try {
|
||||||
downloadString(JSON.stringify(j), j['story_name']+".json")
|
let r = await fetch("json");
|
||||||
}
|
let j = await r.json();
|
||||||
catch(err) {
|
downloadString(JSON.stringify(j), j['story_name']+".json")
|
||||||
|
downloaded = true;
|
||||||
|
}
|
||||||
|
catch(err) {
|
||||||
|
downloaded = false;
|
||||||
|
}
|
||||||
|
} if (downloaded == false) {
|
||||||
//first we're going to find all the var_sync_story_ classes used in the document.
|
//first we're going to find all the var_sync_story_ classes used in the document.
|
||||||
let allClasses = [];
|
let allClasses = [];
|
||||||
const allElements = document.querySelectorAll('*');
|
const allElements = document.querySelectorAll('*');
|
||||||
|
Reference in New Issue
Block a user