Improved search
This commit is contained in:
parent
b165e117bb
commit
f2386ee9c7
@ -223,13 +223,19 @@ export class AnimeNotifier {
|
|||||||
let headers = new Headers()
|
let headers = new Headers()
|
||||||
headers.append("X-Reload", "true")
|
headers.append("X-Reload", "true")
|
||||||
|
|
||||||
return fetch("/_" + this.app.currentPath, {
|
let path = this.app.currentPath
|
||||||
|
|
||||||
|
return fetch("/_" + path, {
|
||||||
credentials: "same-origin",
|
credentials: "same-origin",
|
||||||
headers
|
headers
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
|
if(this.app.currentPath !== path) {
|
||||||
|
return Promise.reject("old request")
|
||||||
|
}
|
||||||
|
|
||||||
this.app.eTag = response.headers.get("ETag")
|
this.app.eTag = response.headers.get("ETag")
|
||||||
return response
|
return Promise.resolve(response)
|
||||||
})
|
})
|
||||||
.then(response => response.text())
|
.then(response => response.text())
|
||||||
.then(html => Diff.innerHTML(this.app.content, html))
|
.then(html => Diff.innerHTML(this.app.content, html))
|
||||||
|
Loading…
Reference in New Issue
Block a user