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);
let reachedCurrentCommit = false;
const newCommits = commits.filter(c => {
if (reachedCurrentCommit) return true;
const newCommits = commits.filter((commit) => {
return (
commit.subject.startsWith("feat") &&
commit.subject.replace("feat:", "").length > 3
);
}).filter(c => {
if (reachedCurrentCommit) return false;
if (c.id === currentCommit) {
reachedCurrentCommit = true;
return false;
}
return true;
});
if (newCommits.length > 1) {
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")
}
}

View File

@ -11,11 +11,16 @@ const createModel = async () => {
return new SemanticSegmentation(rawModel, base);
};
const model = createModel();
model.then(() => console.log(`Loaded the model successfully!`));
let model;
self.addEventListener('message', async (e) => {
if (!model) {
model = await createModel();
console.log("[AI] loaded model")
}
const { pixels, width, height, i } = e.data;
var array = new Uint8ClampedArray(pixels);