mirror of
https://gitlab1.ptb.de/waltem01/Matrix
synced 2024-12-25 11:31:46 +00:00
save image and url
This commit is contained in:
parent
0831e751c3
commit
a1d177678c
@ -7,20 +7,25 @@
|
||||
interval: NodeJS.Timeout;
|
||||
}
|
||||
|
||||
let imageURL: string, uploadData: UploadData;
|
||||
let imageURL: string | null, lastImage: File;
|
||||
let uploadData: UploadData;
|
||||
|
||||
async function sendImage() {}
|
||||
|
||||
function uploadImage(event: Event) {
|
||||
// Revoke previous image url, if any
|
||||
if (imageURL) URL.revokeObjectURL(imageURL);
|
||||
if (imageURL) {
|
||||
URL.revokeObjectURL(imageURL);
|
||||
imageURL = null;
|
||||
}
|
||||
|
||||
// Get user input
|
||||
const input = event.target as HTMLInputElement;
|
||||
const file = input?.files?.[0];
|
||||
if (!file) return;
|
||||
|
||||
// Load image data from file
|
||||
// Load image data and file
|
||||
lastImage = file;
|
||||
imageURL = URL.createObjectURL(file);
|
||||
|
||||
// Time upload by saving date
|
||||
|
Loading…
Reference in New Issue
Block a user