Create new thread

This commit is contained in:
2017-06-27 04:15:52 +02:00
parent 4d24b817ff
commit 8758baa0fa
7 changed files with 94 additions and 19 deletions

View File

@ -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, {