Fix: Resolve implicit any and property access errors in core components
This commit is contained in:
@@ -74,11 +74,11 @@
|
|||||||
reencode: null,
|
reencode: null,
|
||||||
video_file: null
|
video_file: null
|
||||||
};
|
};
|
||||||
let download_clip_src: string = $state();
|
let download_clip_src: string = $state('');
|
||||||
let download_clip_filename: string;
|
let download_clip_filename: string = $state('clipped_video.mp4');
|
||||||
|
|
||||||
// *** Functions and Logic
|
// *** Functions and Logic
|
||||||
async function handle_submit_form_files(event: SubmitEvent) {
|
async function handle_submit_form_files(event: Event) {
|
||||||
console.log('*** handle_submit_form() ***');
|
console.log('*** handle_submit_form() ***');
|
||||||
|
|
||||||
$ae_sess.files.disable_submit__hosted_file_obj = true;
|
$ae_sess.files.disable_submit__hosted_file_obj = true;
|
||||||
@@ -169,7 +169,7 @@
|
|||||||
upload_complete = true;
|
upload_complete = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handle_input_upload_files(input_upload_files, form_kv, task_id) {
|
async function handle_input_upload_files(input_upload_files: File[], form_kv: any, task_id: string) {
|
||||||
console.log('*** handle_input_upload_files() ***');
|
console.log('*** handle_input_upload_files() ***');
|
||||||
console.log(input_upload_files);
|
console.log(input_upload_files);
|
||||||
console.log(form_kv);
|
console.log(form_kv);
|
||||||
|
|||||||
@@ -95,19 +95,21 @@
|
|||||||
let hosted_file_results;
|
let hosted_file_results;
|
||||||
|
|
||||||
const target = event.target as HTMLFormElement;
|
const target = event.target as HTMLFormElement;
|
||||||
|
const file_input = target ? (target[input_element_id] as HTMLInputElement) : null;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
target &&
|
target &&
|
||||||
target[input_element_id] &&
|
file_input &&
|
||||||
(target[input_element_id] as HTMLInputElement)?.files &&
|
file_input.files &&
|
||||||
(target[input_element_id] as HTMLInputElement).files.length > 0
|
file_input.files.length > 0
|
||||||
) {
|
) {
|
||||||
task_id = link_to_id; // Ideally this should be the file hash, but we may be uploading multiple files at once. This should be done with a loop instead?
|
task_id = link_to_id; // Ideally this should be the file hash, but we may be uploading multiple files at once. This should be done with a loop instead?
|
||||||
|
|
||||||
// Loop through each file and upload them individually in event.target[input_element_id].files
|
// Loop through each file and upload them individually in event.target[input_element_id].files
|
||||||
// The task_id should be the file hash.
|
// The task_id should be the file hash.
|
||||||
// processed_file_list[i] has the file hash_sha256, hash_sha256_match, warnings, uploaded, uploaded_bytes, filename, and file_size_bytes.
|
// processed_file_list[i] has the file hash_sha256, hash_sha256_match, warnings, uploaded, uploaded_bytes, filename, and file_size_bytes.
|
||||||
for (let i = 0; i < event.target[input_element_id].files.length; i++) {
|
for (let i = 0; i < file_input.files.length; i++) {
|
||||||
let tmp_file = event.target[input_element_id].files[i];
|
let tmp_file = file_input.files[i];
|
||||||
|
|
||||||
task_id = $ae_sess.files.processed_file_list[i].hash_sha256;
|
task_id = $ae_sess.files.processed_file_list[i].hash_sha256;
|
||||||
|
|
||||||
@@ -126,7 +128,7 @@
|
|||||||
// hosted_file_results = await handle_input_upload_files(event.target[input_element_id].files, task_id);
|
// hosted_file_results = await handle_input_upload_files(event.target[input_element_id].files, task_id);
|
||||||
$ae_sess.files.processed_file_list = [];
|
$ae_sess.files.processed_file_list = [];
|
||||||
$ae_sess = $ae_sess; // Is this needed? 2025-03-17
|
$ae_sess = $ae_sess; // Is this needed? 2025-03-17
|
||||||
event.target.reset();
|
target.reset();
|
||||||
// await tick();
|
// await tick();
|
||||||
|
|
||||||
if (log_lvl) {
|
if (log_lvl) {
|
||||||
|
|||||||
@@ -213,7 +213,7 @@
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err: any) => {
|
||||||
console.log('There was an error while trying to start the QR scanner');
|
console.log('There was an error while trying to start the QR scanner');
|
||||||
scanning_status = 'start_error';
|
scanning_status = 'start_error';
|
||||||
|
|
||||||
@@ -320,7 +320,7 @@
|
|||||||
qr_entered_text = null;
|
qr_entered_text = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function send_init_confirm_email(subject, message) {
|
function send_init_confirm_email(subject: string, message: any) {
|
||||||
console.log(`*** send_init_confirm_email() *** ${subject}`);
|
console.log(`*** send_init_confirm_email() *** ${subject}`);
|
||||||
|
|
||||||
let to_email = 'scott.idem+skdev@oneskyit.com';
|
let to_email = 'scott.idem+skdev@oneskyit.com';
|
||||||
|
|||||||
@@ -258,14 +258,14 @@
|
|||||||
return processed_file_list;
|
return processed_file_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
function remove_file_from_filelist(index) {
|
function remove_file_from_filelist(index: number) {
|
||||||
console.log('*** remove_file_from_filelist() ***');
|
console.log('*** remove_file_from_filelist() ***');
|
||||||
|
|
||||||
// Can not use something like this because it is readonly:
|
// Can not use something like this because it is readonly:
|
||||||
const dt = new DataTransfer();
|
const dt = new DataTransfer();
|
||||||
// let input = document.getElementById(input_element_id);
|
// let input = document.getElementById(input_element_id);
|
||||||
|
|
||||||
let input_element = document.querySelector('input[type="file"].svelte_input_file_element');
|
let input_element = document.querySelector('input[type="file"].svelte_input_file_element') as HTMLInputElement;
|
||||||
|
|
||||||
if (!input_element) {
|
if (!input_element) {
|
||||||
console.error('Could not find the input element.');
|
console.error('Could not find the input element.');
|
||||||
|
|||||||
Reference in New Issue
Block a user