Offline Downloader Fix

This commit is contained in:
ebolam
2022-11-11 18:52:29 -05:00
parent d70ed69dae
commit 7ad904bcc5

View File

@@ -2371,12 +2371,18 @@ function process_log_message(full_data) {
//--------------------------------------------UI to Server Functions----------------------------------
async function download_story_to_json() {
//document.getElementById('download_iframe').src = 'json';
try {
let r = await fetch("json");
let j = await r.json();
downloadString(JSON.stringify(j), j['story_name']+".json")
}
catch(err) {
downloaded = false;
if (socket.connected) {
try {
let r = await fetch("json");
let j = await r.json();
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.
let allClasses = [];
const allElements = document.querySelectorAll('*');