Skip to content

Commit 22c4875

Browse files
committed
fix: only fetch project when upstream is available
Signed-off-by: Evan Song <theevansong@gmail.com>
1 parent 45a326b commit 22c4875

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

apps/frontend/src/components/ui/servers/ServerListing.vue

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,24 @@ const showGameLabel = computed(() => !!props.game);
9191
const showLoaderLabel = computed(() => !!props.loader);
9292
const showSubdomainLabel = computed(() => !!props.net?.domain);
9393
94-
const { data: projectData } = await useLazyAsyncData<Project>(
95-
`server-project-${props.server_id}`,
96-
async (): Promise<Project> => {
97-
const result = await useBaseFetch(
98-
`project/${props.upstream?.project_id}`,
99-
{},
100-
false,
101-
prodOverride,
102-
);
103-
return result as Project;
104-
},
105-
);
94+
let projectData;
95+
if (props.upstream) {
96+
const { data } = await useLazyAsyncData<Project>(
97+
`server-project-${props.server_id}`,
98+
async (): Promise<Project> => {
99+
const result = await useBaseFetch(
100+
`project/${props.upstream?.project_id}`,
101+
{},
102+
false,
103+
prodOverride,
104+
);
105+
return result as Project;
106+
},
107+
);
108+
projectData = data;
109+
} else {
110+
projectData = ref(undefined);
111+
}
106112
107113
const image = ref<string | undefined>();
108114

0 commit comments

Comments
 (0)