mirror of
				https://github.com/cse110-fa22-group29/cse110-fa22-group29.git
				synced 2025-10-31 03:46:50 +00:00 
			
		
		
		
	Add functional service worker caching towards local first functionality,
fix favicon link issue in ReviewDetails.html Co-authored-by: rheabhutada02 <rheabhutada02@users.noreply.github.com> Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
		| @@ -99,7 +99,7 @@ function setupUpdate(){ | ||||
| 			while (tagContainer.firstChild) { | ||||
| 				tagContainer.removeChild(tagContainer.firstChild); | ||||
| 			} | ||||
| 			let tagSetVal = currReview["tags"][i].toLowerCase() | ||||
| 			let tagSetVal = currReview["tags"][i].toLowerCase(); | ||||
| 			for (let i = 0; i < currReview["tags"].length; i++) { | ||||
| 				tagSet.add(tagSetVal); | ||||
| 				let newTag = document.createElement("label"); | ||||
|   | ||||
| @@ -40,3 +40,16 @@ function initFormHandler() { | ||||
| 		window.location.assign("./CreatePage.html"); | ||||
| 	}); | ||||
| } | ||||
|  | ||||
| const registerServiceWorker = async () => { | ||||
| 	if ("serviceWorker" in navigator) { | ||||
| 		try { | ||||
| 			const registration = await navigator.serviceWorker.register("./sw.js", { | ||||
| 				scope: "./", | ||||
| 			}); | ||||
| 		} catch (error) { | ||||
| 			console.error(`Registration failed with ${error}`); | ||||
| 		} | ||||
| 	} | ||||
| }; | ||||
| registerServiceWorker(); | ||||
		Reference in New Issue
	
	Block a user