Create new thread
This commit is contained in:
@ -153,7 +153,7 @@ export class AnimeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
load(url: string) {
|
||||
diff(url: string) {
|
||||
let request = fetch("/_" + url, {
|
||||
credentials: "same-origin"
|
||||
})
|
||||
@ -175,6 +175,20 @@ export class AnimeNotifier {
|
||||
})
|
||||
}
|
||||
|
||||
post(url, obj) {
|
||||
return fetch(url, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(obj),
|
||||
credentials: "same-origin"
|
||||
})
|
||||
.then(response => response.text())
|
||||
.then(body => {
|
||||
if(body !== "ok") {
|
||||
throw body
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
onPopState(e: PopStateEvent) {
|
||||
if(e.state) {
|
||||
this.app.load(e.state, {
|
||||
|
Reference in New Issue
Block a user