Skip to content

Commit 6b7273d

Browse files
committed
Show loading modal with session
1 parent 8a76aee commit 6b7273d

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

components/files.html

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,9 +403,26 @@ <h5 id="sequence-controls-title" class="modal-title">Sequence Settings</h5>
403403
return;
404404
}
405405
if (extension == 'microbetrace' || extension == 'hivtrace') {
406-
let reader = new FileReader();
407-
reader.onloadend = out => MT.processJSON(out.target.result, extension);
408-
reader.readAsText(rawfile, 'UTF-8');
406+
document.getElementById('loading-information').innerHTML="<p>Processing file(s)...</p>";
407+
new Promise(function(resolve, reject) {
408+
$('#loading-information-modal').on('shown.bs.modal', function (e) {
409+
session.messages = [];
410+
$('#loading-information').html('');
411+
resolve("done");
412+
});
413+
$('#loading-information-modal').modal({
414+
backdrop: false,
415+
keyboard: false
416+
});
417+
session.network.launched = true;
418+
setTimeout(() => reject(new Error("Problem loading information modal!")), 5000);
419+
}).then(
420+
result => {let reader = new FileReader();
421+
reader.onloadend = out => MT.processJSON(out.target.result, extension);
422+
reader.readAsText(rawfile, 'UTF-8');}, //
423+
error => {alert(error); launch(); } // informational modal doesn't load
424+
);
425+
409426
return;
410427
}
411428
if (extension == 'svg') {

0 commit comments

Comments
 (0)