fix: changelog was confused which commits where new

This commit is contained in:
max_richter 2021-03-16 16:13:25 +01:00
parent 396c2c4b4d
commit 433a17848e
2 changed files with 17 additions and 5 deletions

View File

@ -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")
} }
} }

View File

@ -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);