Skip to content

Commit

Permalink
fix: handle unknown Statement sources (#879)
Browse files Browse the repository at this point in the history
* feat: add Safe statement source

* fix: handle unknown sources
  • Loading branch information
Sekhmet authored Oct 16, 2024
1 parent da442fe commit 07929e3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apps/ui/src/views/SpaceUser/Statement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ const loading = ref(false);
const statement = ref<Statement | null>(null);
const userId = computed(() => route.params.user as string);
const shouldShowSource = computed(() => {
if (!statement.value?.source) return false;
return statement.value.source in SOURCE_ICONS;
});
async function loadStatement() {
loading.value = true;
Expand Down Expand Up @@ -101,7 +106,7 @@ watchEffect(() =>
class="text-skin-heading max-w-[592px]"
:body="statement.statement"
/>
<div v-if="statement.source">
<div v-if="shouldShowSource">
<h4 class="eyebrow text-skin-text mb-2">Source</h4>
<a
:href="SOURCE_ICONS[statement.source].link"
Expand Down

0 comments on commit 07929e3

Please sign in to comment.