Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| aa724dbd0b | |||
| 328b58b49b | |||
| c41ca5ffbe | |||
| 16593dfc34 | |||
| 837f34ed50 |
@@ -74,7 +74,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="projectIsAccesible && !projectIsAccesible"
|
||||
v-if="projectIsAccesible === false"
|
||||
class="px-2 py-4 bg-foundation dark:bg-neutral-700/10 rounded-md shadow"
|
||||
>
|
||||
<CommonAlert
|
||||
@@ -145,10 +145,25 @@ const projectNavigatorTippy = computed(() =>
|
||||
|
||||
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) => {
|
||||
|
||||
Reference in New Issue
Block a user