From a5802c30bfb0cf35c9afc52d21738f64b314839d Mon Sep 17 00:00:00 2001 From: pimothyxd Date: Sun, 17 Dec 2023 17:14:16 +0100 Subject: [PATCH] refactor: add fallback preview image --- src/site/twitch.tv/modules/sidebar-previews/SidebarCard.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/site/twitch.tv/modules/sidebar-previews/SidebarCard.vue b/src/site/twitch.tv/modules/sidebar-previews/SidebarCard.vue index cfa280b7f..7aaa4eb81 100644 --- a/src/site/twitch.tv/modules/sidebar-previews/SidebarCard.vue +++ b/src/site/twitch.tv/modules/sidebar-previews/SidebarCard.vue @@ -11,6 +11,8 @@ const props = defineProps<{ instance: HookedInstance; }>(); +const SIDEBAR_PREVIEW_FALLBACK = "https://vod-secure.twitch.tv/_404/404_processing_320x180.png"; + const showPreviews = useConfig("ui.sidebar_previews"); const tooltipContent = ref(); @@ -70,7 +72,7 @@ function patchTooltip(tooltip: ReactExtended.ReactRuntimeElement, vnode: ReactEx props: { className: "seventv-sidebar-tooltip-preview", style: { - backgroundImage: getThumbnail(tooltip.props.streamPreviewImage), + backgroundImage: getThumbnail(tooltip.props.streamPreviewImage ?? SIDEBAR_PREVIEW_FALLBACK), }, }, });