More fixes

This commit is contained in:
2017-07-14 01:50:10 +02:00
parent f2386ee9c7
commit 815f99ce9c
4 changed files with 5 additions and 15 deletions

View File

@ -206,20 +206,12 @@ export function search(arn: AnimeNotifier, search: HTMLInputElement, e: Keyboard
let term = search.value
arn.app.currentPath = "/search/" + term
if(window.location.pathname.startsWith("/search/")) {
history.replaceState("search", null, arn.app.currentPath)
} else {
history.pushState("search", null, arn.app.currentPath)
}
if(!term || term.length < 2) {
arn.app.content.innerHTML = "Please enter at least 2 characters to start searching."
return
}
arn.reloadContent()
arn.diff("/search/" + term)
}
// Add anime to collection

View File

@ -134,9 +134,7 @@ export class AnimeNotifier {
return
}
navigator.serviceWorker.register("service-worker", {
scope: "./"
}).then(registration => {
navigator.serviceWorker.register("/service-worker").then(registration => {
registration.update()
})
@ -409,7 +407,7 @@ export class AnimeNotifier {
}
diff(url: string) {
if(url == this.app.currentPath) {
if(url === this.app.currentPath) {
return Promise.reject(null)
}