Fixed TypeScript 3.6 errors

This commit is contained in:
Eduard Urbach 2019-09-06 14:57:43 +09:00
parent b69c21bf0a
commit acb9849e00
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0

View File

@ -388,7 +388,7 @@ export default class AnimeNotifier {
}
element.addEventListener("drop", async e => {
let toElement: Element | null = e.toElement
let toElement: HTMLElement | null = e.target as HTMLElement
// Find tab element
while(toElement && !toElement.classList.contains("tab")) {
@ -507,7 +507,7 @@ export default class AnimeNotifier {
e.preventDefault()
}, false)
element.addEventListener("drop", e => {
element.addEventListener("drop", async e => {
element.classList.remove("drag-enter")
e.stopPropagation()
@ -536,8 +536,11 @@ export default class AnimeNotifier {
// Swap in database
let apiEndpoint = this.findAPIEndpoint(inventory)
this.post(apiEndpoint + "/swap/" + fromIndex + "/" + toIndex)
.catch(err => this.statusMessage.showError(err))
try {
await this.post(apiEndpoint + "/swap/" + fromIndex + "/" + toIndex)
} catch(err) {
this.statusMessage.showError(err)
}
// Swap in UI
swapElements(fromElement, element)