fix: changelog was confused which commits where new
This commit is contained in:
		| @@ -16,16 +16,23 @@ import { commitStore, route } from "stores"; | |||||||
|   localStorage.setItem("currentCommit", currentCommit); |   localStorage.setItem("currentCommit", currentCommit); | ||||||
|  |  | ||||||
|   let reachedCurrentCommit = false; |   let reachedCurrentCommit = false; | ||||||
|   const newCommits = commits.filter(c => { |   const newCommits = commits.filter((commit) => { | ||||||
|     if (reachedCurrentCommit) return true; |     return ( | ||||||
|  |       commit.subject.startsWith("feat") && | ||||||
|  |       commit.subject.replace("feat:", "").length > 3 | ||||||
|  |     ); | ||||||
|  |   }).filter(c => { | ||||||
|  |     if (reachedCurrentCommit) return false; | ||||||
|     if (c.id === currentCommit) { |     if (c.id === currentCommit) { | ||||||
|       reachedCurrentCommit = true; |       reachedCurrentCommit = true; | ||||||
|  |       return false; | ||||||
|     } |     } | ||||||
|  |     return true; | ||||||
|   }); |   }); | ||||||
|  |  | ||||||
|   if (newCommits.length > 1) { |   if (newCommits.length > 1) { | ||||||
|     if (window.location.hash !== "#changelog") { |     if (window.location.hash !== "#changelog") { | ||||||
|       if ((await Toast.ask(`There are <b>${newCommits.length}</b> updates. Do you want to see them?`, ["yes", "no"])) === "yes") { |       if ((await Toast.ask(`✨ There are <b>${newCommits.length}</b> updates ✨.<br>Do you want to see them?`, ["yes", "no"])) === "yes") { | ||||||
|         route.set("changelog") |         route.set("changelog") | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -11,11 +11,16 @@ const createModel = async () => { | |||||||
|   return new SemanticSegmentation(rawModel, base); |   return new SemanticSegmentation(rawModel, base); | ||||||
| }; | }; | ||||||
|  |  | ||||||
| const model = createModel(); | let model; | ||||||
| model.then(() => console.log(`Loaded the model successfully!`)); |  | ||||||
|  |  | ||||||
| self.addEventListener('message', async (e) => { | self.addEventListener('message', async (e) => { | ||||||
|  |  | ||||||
|  |   if (!model) { | ||||||
|  |     model = await createModel(); | ||||||
|  |     console.log("[AI] loaded model") | ||||||
|  |   } | ||||||
|  |  | ||||||
|   const { pixels, width, height, i } = e.data; |   const { pixels, width, height, i } = e.data; | ||||||
|  |  | ||||||
|   var array = new Uint8ClampedArray(pixels); |   var array = new Uint8ClampedArray(pixels); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user