fix project edits being ignored in UI unless they change the pretty ID.
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-11-20 17:31:31 +01:00
parent 995504d969
commit 158386d6fd
@@ -22,12 +22,10 @@
import { getContext, setContext } from "svelte";
import { sl3 } from "$lib/clients/sl3";
import { getScopeContext } from "./ScopeContext.svelte";
import { getStores } from "$app/stores";
export let project: Project;
const {scope} = getScopeContext();
const {page} = getStores();
let projectWritable = writable<Project>(project);
let lastSet = project;
@@ -46,12 +44,15 @@
try {
const newProject = await sl3(fetch).findProject($scope.id, project.id)
projectWritable.set(newProject);
} catch(_) {}
} catch(e) {
console.warn("Failed to reload project:", e);
}
loading = false;
}
$: if (project !== lastSet) {
lastSet = project;
projectWritable.set(project);
}
</script>