Skip to content

Commit 8ed8d76

Browse files
committed
whattheduck: Fix race condition preventing inital load in some cases
1 parent b60f91d commit 8ed8d76

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

apps/whattheduck/src/views/AppWithPersistedData.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const isCollectionLoaded = ref(false);
2929
const dataLoader = computed(() => socket.value!.socket.cacheHydrator);
3030
3131
const collectionLoadProgress = computed(() => {
32-
if (dataLoader.value.state.value?.mode === 'HYDRATE') {
32+
if (dataLoader.value.state?.value?.mode === 'HYDRATE') {
3333
return dataLoader.value.state.value.hydratedCallsDoneAmount / dataLoader.value.state.value.cachedCallsDone.length;
3434
} else {
3535
return undefined;
@@ -38,8 +38,8 @@ const collectionLoadProgress = computed(() => {
3838
3939
const isCollectionReadonly = computed(
4040
() =>
41-
dataLoader.value.state.value?.mode === 'LOAD_CACHE' ||
42-
(dataLoader.value.state.value?.mode === 'HYDRATE' &&
41+
dataLoader.value.state?.value?.mode === 'LOAD_CACHE' ||
42+
(dataLoader.value.state?.value?.mode === 'HYDRATE' &&
4343
collectionLoadProgress.value !== undefined &&
4444
collectionLoadProgress.value < 1),
4545
);

0 commit comments

Comments
 (0)