Changes from before AAPOR

This commit is contained in:
Scott Idem
2024-05-20 17:24:23 -04:00
parent f72d7be5b2
commit fa58d1accb
13 changed files with 609 additions and 21 deletions

View File

@@ -196,6 +196,9 @@ export let ae_app_session_data_struct: key_val = {
},
'testing': {},
},
'download': {},
'download_li': {},
};
// console.log(`AE Stores - App Session Storage Data:`, ae_app_session_data_struct);
export let ae_sess = writable(ae_app_session_data_struct);

View File

@@ -309,6 +309,17 @@ export let get_object = async function get_object(
console.log('GET Blob Timestamp:', progressEvent.timeStamp, 'Total:', progressEvent.total, 'Loaded:', progressEvent.loaded, 'Percent Completed', percent_completed);
temp_get_blob_percent_completed = percent_completed;
// WARNING: This needs to be tied to an object type and ID. This is a temporary solution.
try {
window.postMessage({
type: 'api_download_blob', endpoint: endpoint, filename: filename, size_total: progressEvent.total, size_loaded: progressEvent.loaded, percent_completed: percent_completed
},
'*'
);
} catch (error) {
console.log('Error posting message to window:', error);
}
}
}
)
@@ -330,6 +341,17 @@ export let get_object = async function get_object(
filename = 'unknown_file.ext';
}
// WARNING: This needs to be tied to an object type and ID. This is a temporary solution.
try {
window.postMessage({
type: 'api_download_blob', endpoint: endpoint, filename: filename, size_total: 0, size_loaded: 0, percent_completed: 100
},
'*'
);
} catch (error) {
console.log('Error posting message to window:', error);
}
if (auto_download) {
if (log_lvl) {
console.log(`Auto Download: ${filename}`);