fix reactivity

This commit is contained in:
Emily
2024-08-07 15:06:06 +02:00
parent 0c8ec73722
commit 4c9efda9ca
13 changed files with 257 additions and 266 deletions

View File

@@ -8,7 +8,7 @@ const remoteSnapshots = useFetch<TProjectSnapshot[]>('/api/project/snapshots', {
const activeProject = useActiveProject();
watch(activeProject, async () => {
await remoteSnapshots.refresh();
snapshot.value = snapshots.value[1];
snapshot.value = isLiveDemo() ? snapshots.value[0] : snapshots.value[1];
});
const snapshots = computed(() => {
@@ -56,7 +56,7 @@ const snapshots = computed(() => {
];
})
const snapshot = ref<TProjectSnapshot>(snapshots.value[1]);
const snapshot = ref<TProjectSnapshot>(isLiveDemo() ? snapshots.value[0] : snapshots.value[1]);
const safeSnapshotDates = computed(() => {
const from = new Date(snapshot.value?.from || 0).toISOString();