bug fixes and other minor improvments

This commit is contained in:
Andrew Gundersen 2022-01-27 16:45:35 -06:00
commit dac7edef21
10 changed files with 36 additions and 26 deletions

View file

@ -1,6 +1,11 @@
const onDrop = async (e) => {
const file = e.dataTransfer.items[0].getAsFile();
if (file.size >= 1 * 1000 * 1000) {
alert("File must be under 1MB.");
return;
}
const buffer = await file.arrayBuffer();
const b64String = await window.mainApi.invoke("encode", buffer);

View file

@ -46,11 +46,17 @@ function useText(elementId, left, typing)
if (e.key === "Enter" && el.value)
{
if (el.value.length >= 250) {
alert("250 character limit")
return;
}
window.mainApi.send("message", {
category: "text",
text: el.value,
blob: null
});
show.value = false;
}
});