Skip to content

Commit 36c6882

Browse files
committed
fix(projectInfo): show external studio host if present
1 parent 4699add commit 36c6882

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/widgets/projectInfo/ProjectInfo.tsx

+12-3
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,20 @@ export function ProjectInfo(props: ProjectInfoProps) {
5353

5454
subscriptions.push(
5555
versionedClient.observable
56-
.request<{studioHost: string}>({uri: `/projects/${projectId}`})
56+
.request<{
57+
studioHost: string
58+
metadata?: {externalStudioHost?: string}
59+
}>({uri: `/projects/${projectId}`, tag: 'dashboard.project-info.studio-host'})
5760
.subscribe({
5861
next: (result) => {
59-
const {studioHost: host} = result
60-
setStudioHost(host ? `https://${host}.sanity.studio` : undefined)
62+
if (result.metadata?.externalStudioHost) {
63+
setStudioHost(result.metadata.externalStudioHost)
64+
return
65+
}
66+
67+
setStudioHost(
68+
result.studioHost ? `https://${result.studioHost}.sanity.studio` : undefined,
69+
)
6170
},
6271
error: (error) => {
6372
console.error('Error while looking for studioHost', error)

0 commit comments

Comments
 (0)