Skip to content

Commit

Permalink
Show loading modal with session
Browse files Browse the repository at this point in the history
  • Loading branch information
Mossy1022 committed Oct 26, 2023
1 parent 8a76aee commit 6b7273d
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions components/files.html
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,26 @@ <h5 id="sequence-controls-title" class="modal-title">Sequence Settings</h5>
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="<p>Processing file(s)...</p>";
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') {
Expand Down

0 comments on commit 6b7273d

Please sign in to comment.