ios: Fix file upload. This is the last thing I would have expected. #109
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 30m36s

This commit is contained in:
Cory McWilliams 2025-03-05 19:48:39 -05:00
parent 59e389d793
commit b7ecfc9925
2 changed files with 8 additions and 4 deletions

View File

@ -255,10 +255,12 @@ class TfComposeElement extends LitElement {
let self = this;
let input = document.createElement('input');
input.type = 'file';
input.onchange = function (event) {
input.addEventListener('change', function (event) {
input.parentNode.removeChild(input);
let file = event.target.files[0];
self.add_file(file);
};
});
document.body.appendChild(input);
input.click();
}

View File

@ -139,7 +139,8 @@ class TfProfileElement extends LitElement {
let self = this;
let input = document.createElement('input');
input.type = 'file';
input.onchange = function (event) {
input.addEventListener('change', function (event) {
input.parentNode.removeChild(input);
let file = event.target.files[0];
file
.arrayBuffer()
@ -154,7 +155,8 @@ class TfProfileElement extends LitElement {
.catch(function (e) {
alert(e.message);
});
};
});
document.body.appendChild(input);
input.click();
}