summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/frontend/src/components/MkUrlPreview.vue7
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/frontend/src/components/MkUrlPreview.vue b/packages/frontend/src/components/MkUrlPreview.vue
index e2844f8fa1..e4a6a87c26 100644
--- a/packages/frontend/src/components/MkUrlPreview.vue
+++ b/packages/frontend/src/components/MkUrlPreview.vue
@@ -10,7 +10,7 @@ SPDX-License-Identifier: AGPL-3.0-only
:style="player.width ? `padding: ${(player.height || 0) / player.width * 100}% 0 0` : `padding: ${(player.height || 0)}px 0 0`"
>
<iframe
- v-if="player.url.startsWith('http://') || player.url.startsWith('https://')"
+ v-if="player.url?.startsWith('http://') || player.url?.startsWith('https://')"
sandbox="allow-popups allow-scripts allow-storage-access-by-user-activation allow-same-origin"
scrolling="no"
:allow="player.allow.join(';')"
@@ -118,11 +118,12 @@ let description = $ref<string | null>(null);
let thumbnail = $ref<string | null>(null);
let icon = $ref<string | null>(null);
let sitename = $ref<string | null>(null);
-let player = $ref({
+let player = $ref<SummalyResult['player']>({
url: null,
width: null,
height: null,
-} as SummalyResult['player']);
+ allow: [],
+});
let playerEnabled = $ref(false);
let tweetId = $ref<string | null>(null);
let tweetExpanded = $ref(props.detail);