fix styling issue,

fix bug in service worker and search URI

Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
Arthur Lu
2022-12-01 17:01:05 -08:00
parent 8924540757
commit 82aba63baf
4 changed files with 7 additions and 6 deletions

View File

@@ -48,7 +48,7 @@ function initFormHandler() {
searchTag = null;
searchField.value = "";
sortAndFilter(searchTag);
})
});
//sort by selected method
let sortMethod = document.getElementById("sort");
@@ -142,7 +142,7 @@ function loadReviews(index, reviewIDs){
moreBtn.setAttribute("id", "more-btn");
moreBtn.innerText = "Load More";
//if load more clicked, load 9 more
moreBtn.addEventListener("click", function(){loadReviews(index + 9, reviewIDs)});
moreBtn.addEventListener("click", function(){loadReviews(index + 9, reviewIDs);});
reviewBox.append(moreBtn);
}
@@ -151,7 +151,7 @@ function loadReviews(index, reviewIDs){
const registerServiceWorker = async () => {
if ("serviceWorker" in navigator) {
try {
const registration = await navigator.serviceWorker.register("./sw.js", {scope: "./"});
await navigator.serviceWorker.register("./sw.js", {scope: "./"});
} catch (error) {
console.error(`Registration failed with ${error}`);
}