From 60a26c39f4e7c2c2b6815427120967f02dc94afa Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Thu, 27 Sep 2018 13:54:02 +0900 Subject: [PATCH] Fixed TypeScript 3 warnings --- scripts/Actions/Upload.ts | 7 +++++-- scripts/ServiceWorkerManager.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/Actions/Upload.ts b/scripts/Actions/Upload.ts index 39f9efb7..77201bda 100644 --- a/scripts/Actions/Upload.ts +++ b/scripts/Actions/Upload.ts @@ -53,7 +53,8 @@ function uploadFile(file: File, fileType: string, endpoint: string, arn: AnimeNo let reader = new FileReader() reader.onloadend = async () => { - let fileSize = reader.result.byteLength + let result = reader.result as ArrayBuffer + let fileSize = result.byteLength if(fileSize === 0) { arn.statusMessage.showError("File is empty") @@ -96,6 +97,8 @@ function previewImage(file: File, endpoint: string, previews: HTMLCollectionOf { + let dataURL = reader.result as string + if(endpoint === "/api/upload/avatar") { let svgPreview = document.getElementById("avatar-input-preview-svg") as HTMLImageElement @@ -114,7 +117,7 @@ function previewImage(file: File, endpoint: string, previews: HTMLCollectionOf