From 6b7273d013ae662c8b7797b53d70d9d3cbbb5a52 Mon Sep 17 00:00:00 2001 From: Evan Moscoso Date: Thu, 26 Oct 2023 15:43:54 -0400 Subject: [PATCH] Show loading modal with session --- components/files.html | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/components/files.html b/components/files.html index bb2cd17b..fdf36d03 100644 --- a/components/files.html +++ b/components/files.html @@ -403,9 +403,26 @@ return; } if (extension == 'microbetrace' || extension == 'hivtrace') { - let reader = new FileReader(); - reader.onloadend = out => MT.processJSON(out.target.result, extension); - reader.readAsText(rawfile, 'UTF-8'); + document.getElementById('loading-information').innerHTML="

Processing file(s)...

"; + new Promise(function(resolve, reject) { + $('#loading-information-modal').on('shown.bs.modal', function (e) { + session.messages = []; + $('#loading-information').html(''); + resolve("done"); + }); + $('#loading-information-modal').modal({ + backdrop: false, + keyboard: false + }); + session.network.launched = true; + setTimeout(() => reject(new Error("Problem loading information modal!")), 5000); + }).then( + result => {let reader = new FileReader(); + reader.onloadend = out => MT.processJSON(out.target.result, extension); + reader.readAsText(rawfile, 'UTF-8');}, // + error => {alert(error); launch(); } // informational modal doesn't load + ); + return; } if (extension == 'svg') {