Working on handling received messages. Open a session.

This commit is contained in:
Scott Idem
2024-10-08 12:13:27 -04:00
parent 0799f9a1ab
commit a6b9115865
8 changed files with 140 additions and 61 deletions

View File

@@ -89,34 +89,34 @@ onMount(() => {
// $ae_event_launcher = $ae_event_launcher;
}
window.addEventListener('message', function(event) {
console.log('Message received in event file uploaded manage component:');
console.log(event);
// window.addEventListener('message', function(event) {
// console.log('Message received in event file uploaded manage component:');
// console.log(event);
if (event.data.type == 'api_download_blob') {
console.log('Download blob (file) message received:');
console.log(event.data);
// if (event.data.type == 'api_download_blob') {
// console.log('Download blob (file) message received:');
// console.log(event.data);
// Get the event_file_id from the event.data.endpoint value.
// Example: /event/file/abc123/download
// // Get the event_file_id from the event.data.endpoint value.
// // Example: /event/file/abc123/download
let endpoint = event.data.endpoint;
let event_file_id = endpoint.split('/')[3];
// let endpoint = event.data.endpoint;
// let event_file_id = endpoint.split('/')[3];
ae_downloads[event_file_id] = {
'size_total': event.data.size_total,
'size_loaded': event.data.size_loaded,
'percent_completed': event.data.percent_completed,
};
// ae_downloads[event_file_id] = {
// 'size_total': event.data.size_total,
// 'size_loaded': event.data.size_loaded,
// 'percent_completed': event.data.percent_completed,
// };
// let event_file_id = event.data.event_file_id;
// let filename = event.data.filename;
// let auto_download = event.data.auto_download;
// // let event_file_id = event.data.event_file_id;
// // let filename = event.data.filename;
// // let auto_download = event.data.auto_download;
// ae_promises[event_file_id]
// ae_promises[event_file_id] = download_event_file({ 'event_file_id': event_file_id, 'return_file': true, filename: filename, auto_download: auto_download, log_lvl: 1 });
}
});
// // ae_promises[event_file_id]
// // ae_promises[event_file_id] = download_event_file({ 'event_file_id': event_file_id, 'return_file': true, filename: filename, auto_download: auto_download, log_lvl: 1 });
// }
// });
});
async function handle_open_file() {