Skip to content

Commit

Permalink
fix: fix blank link preview when url has no page title (#900)
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e authored Oct 17, 2024
1 parent 24af383 commit 144e5d0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions apps/ui/src/components/Ui/LinkPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ debouncedWatch(
<div
v-if="preview?.meta || (showDefault && !previewLoading)"
class="flex items-center px-4 py-3 border rounded-lg"
:class="{ 'gap-2': showDefault, '!gap-4': preview?.meta?.title }"
:class="{
'gap-2': showDefault,
'!gap-4': preview?.meta?.title || previewIconResolved
}"
>
<template v-if="preview?.meta?.title">
<template v-if="preview && (preview?.meta?.title || previewIconResolved)">
<img
v-if="previewIconResolved"
:src="preview.links.icon[0].href"
Expand All @@ -70,7 +73,10 @@ debouncedWatch(
:alt="preview.meta.title"
/>
<div class="flex flex-col truncate">
<div class="text-skin-link truncate" v-text="preview.meta.title" />
<div
class="text-skin-link truncate"
v-text="preview.meta.title || props.url"
/>
<div
v-if="preview.meta.description"
class="text-[17px] text-skin-text truncate"
Expand Down

0 comments on commit 144e5d0

Please sign in to comment.