Fixed TypeScript 3.6 errors
This commit is contained in:
parent
b69c21bf0a
commit
acb9849e00
@ -388,7 +388,7 @@ export default class AnimeNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
element.addEventListener("drop", async e => {
|
element.addEventListener("drop", async e => {
|
||||||
let toElement: Element | null = e.toElement
|
let toElement: HTMLElement | null = e.target as HTMLElement
|
||||||
|
|
||||||
// Find tab element
|
// Find tab element
|
||||||
while(toElement && !toElement.classList.contains("tab")) {
|
while(toElement && !toElement.classList.contains("tab")) {
|
||||||
@ -507,7 +507,7 @@ export default class AnimeNotifier {
|
|||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
}, false)
|
}, false)
|
||||||
|
|
||||||
element.addEventListener("drop", e => {
|
element.addEventListener("drop", async e => {
|
||||||
element.classList.remove("drag-enter")
|
element.classList.remove("drag-enter")
|
||||||
|
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
@ -536,8 +536,11 @@ export default class AnimeNotifier {
|
|||||||
// Swap in database
|
// Swap in database
|
||||||
let apiEndpoint = this.findAPIEndpoint(inventory)
|
let apiEndpoint = this.findAPIEndpoint(inventory)
|
||||||
|
|
||||||
this.post(apiEndpoint + "/swap/" + fromIndex + "/" + toIndex)
|
try {
|
||||||
.catch(err => this.statusMessage.showError(err))
|
await this.post(apiEndpoint + "/swap/" + fromIndex + "/" + toIndex)
|
||||||
|
} catch(err) {
|
||||||
|
this.statusMessage.showError(err)
|
||||||
|
}
|
||||||
|
|
||||||
// Swap in UI
|
// Swap in UI
|
||||||
swapElements(fromElement, element)
|
swapElements(fromElement, element)
|
||||||
|
Loading…
Reference in New Issue
Block a user