Skip to content

Commit

Permalink
fixed more cases of faulty empty array handling
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Apr 15, 2024
1 parent dad1d22 commit bee57ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webclient/pages/[view]/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const runtimeConfig = useRuntimeConfig();
const url = computed(() => `${runtimeConfig.public.apiURL}/api/get/${route.params.id}?lang=${locale.value}`);
const { data, error } = useFetch<DetailsResponse, string>(url, { key: "details" });
const shownImage = ref<ImageInfo | undefined>(data.value?.imgs ? data.value.imgs[0] : undefined);
const shownImage = ref<ImageInfo | undefined>(data.value?.imgs?.length ? data.value.imgs[0] : undefined);
const slideshowOpen = ref(false);
const clipboardSource = computed(() => `https://nav.tum.de${route.fullPath}`);
Expand Down Expand Up @@ -55,7 +55,7 @@ watch([data], () => {
slideshowOpen.value = false;
selectedMap.value = data.value.maps.default;
// --- Images ---
shownImage.value = data.value.imgs ? data.value.imgs[0] : undefined;
shownImage.value = data.value.imgs?.length ? data.value.imgs[0] : undefined;
tryToLoadMap();
});
Expand Down

0 comments on commit bee57ee

Please sign in to comment.