Fixed WebP loading and auto-update avatar

This commit is contained in:
2018-03-03 16:44:21 +01:00
parent 61f4fdb386
commit 634fed8e87
3 changed files with 17 additions and 5 deletions

View File

@ -48,6 +48,12 @@ function uploadFile(file: File, endpoint: string, arn: AnimeNotifier) {
body: reader.result
})
let newURL = await response.text()
let sidebar = document.getElementById("sidebar")
let userImage = sidebar.getElementsByClassName("user-image")[0] as HTMLImageElement
userImage.dataset.src = newURL
userImage["became visible"]()
if(response.ok) {
arn.statusMessage.showInfo("Successfully uploaded your new avatar.")
} else {