From 2ca577fe60577a82daa8e966b849a6e7ba391a31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Steinhagen?= <88777268+bjoernsteinhagen@users.noreply.github.com> Date: Fri, 10 Apr 2026 10:45:16 +0200 Subject: [PATCH] fix: show inaccessible state for project collapsible when account is missing (#103) * fix(dui): show remove option for inaccessible project groups * fix: show inaccessible state for project collapsible when account is missing * chore: reverting previous unrelated changes --- components/common/ProjectModelGroup.vue | 31 ++++++++++++++++++++----- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/components/common/ProjectModelGroup.vue b/components/common/ProjectModelGroup.vue index 6c4d342..b17b451 100644 --- a/components/common/ProjectModelGroup.vue +++ b/components/common/ProjectModelGroup.vue @@ -74,7 +74,7 @@
const clientId = projectAccount.value.accountInfo.id -const { result: projectDetailsResult, refetch: refetchProjectDetails } = useQuery( +const accountExists = accountStore.isAccountExistsById(props.project.accountId) + +if (!accountExists) { + projectIsAccesible.value = false +} + +const { + result: projectDetailsResult, + refetch: refetchProjectDetails, + onError: onProjectDetailsError +} = useQuery( projectDetailsQuery, () => ({ projectId: props.project.projectId }), - () => ({ clientId, debounce: 500, fetchPolicy: 'network-only' }) + () => ({ + clientId, + debounce: 500, + fetchPolicy: 'network-only', + enabled: accountExists + }) ) const removeProjectModels = async () => { @@ -162,6 +177,10 @@ watch(projectDetails, (newValue) => { projectIsAccesible.value = newValue !== undefined }) +onProjectDetailsError(() => { + projectIsAccesible.value = false +}) + const canLoad = computed(() => !!projectDetails.value?.permissions.canLoad.authorized) const canPublish = computed( () => !!projectDetails.value?.permissions.canPublish.authorized @@ -194,13 +213,13 @@ const isWorkspaceReadOnly = computed(() => { const { onResult: userProjectsUpdated } = useSubscription( userProjectsUpdatedSubscription, () => ({}), - () => ({ clientId }) + () => ({ clientId, enabled: accountExists }) ) const { onResult: projectUpdated } = useSubscription( projectUpdatedSubscription, () => ({ projectId: props.project.projectId }), - () => ({ clientId }) + () => ({ clientId, enabled: accountExists }) ) // to catch changes on visibility of project @@ -236,7 +255,7 @@ const workspaceUrl = computed(() => { const { onResult } = useSubscription( versionCreatedSubscription, () => ({ projectId: props.project.projectId }), - () => ({ clientId }) + () => ({ clientId, enabled: accountExists }) ) onResult((res) => {