remove some superfluous logging

This commit is contained in:
Vivian Lim 2020-07-23 20:10:25 -07:00
parent c663014dc7
commit 61d47c02fe
1 changed files with 0 additions and 12 deletions

View File

@ -23,8 +23,6 @@ document.addEventListener('paste', async (e: any) => {
}
if (e.clipboardData.types.includes("Files")){ // Does the clipboard being pasted contain files?
console.log("it's an imageeee");
for (let i = 0; i < e.clipboardData.items.length; i++){
let transferItem = e.clipboardData.items[i];
let file = e.clipboardData.files[i];
@ -42,14 +40,12 @@ document.addEventListener('paste', async (e: any) => {
credentials: 'same-origin',
body: form
});
console.log(response);
let responseData = await response.json();
if (!responseData.ok){
notifier.alert(`Failed to upload your image: ${responseData.error}.`);
return;
}
console.log(responseData);
let textArea = document.getElementById("message") as HTMLTextAreaElement;
typeInTextarea(responseData.insert_text, textArea);
notifier.success("Successfully attached image.");
@ -58,12 +54,4 @@ document.addEventListener('paste', async (e: any) => {
await notifier.asyncBlock(uploadPromise(), null, null, "Uploading image...", {'minDurations': {'async-block': 100}});
}
}
try {
let text = await navigator.clipboard.readText();
e.preventDefault();
text = text.toUpperCase();
console.log('Pasted UPPERCASE text: ', text);
} catch (err) {
console.error('Failed to read clipboard contents: ', err);
}
});