Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

Commit

Permalink
chore: clean log for new file + display filename
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Ratiashvili committed Dec 14, 2021
1 parent 2f370ef commit 7711f32
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Encoder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,17 @@ encoderDataEl.addEventListener("drop", function (event) {
const item = event.dataTransfer.items[0];
const file = item.getAsFile();
if (!file) return;
filename = file.name.substr(0, 255);
filename = file.name.substring(0, 255);
(async () => {
const contents = await file?.text();
const textareaEL = document.getElementById(
"encoderData"
) as HTMLTextAreaElement;
if (!textareaEL || !contents) return;
textareaEL.value = contents;
cleanLog();
await addLog(`File added: ${filename}; Size: ${contents.length}`);
setResultImage(undefined);
})();
}
});
Expand Down

0 comments on commit 7711f32

Please sign in to comment.