Skip to content

Commit

Permalink
Use URL as fallback in absence of weblink description
Browse files Browse the repository at this point in the history
  • Loading branch information
dokempf committed Jul 31, 2024
1 parent 92d4d79 commit 2e4e0b4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/fields/CustomDataTypeLink.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
export let field;
const fdata = fieldData(data, table, field);
function findText() {
if ("text" in fdata) {
return bestLanguage(fdata.text, $dataLanguagesStore)
}
return fdata.url;
}
</script>

<A href={fdata.url}>{bestLanguage(fdata.text, $dataLanguagesStore)}</A>
<A href={fdata.url}>{findText()}</A>

0 comments on commit 2e4e0b4

Please sign in to comment.