Skip to content

Commit

Permalink
refactor: add fallback preview image
Browse files Browse the repository at this point in the history
  • Loading branch information
pimothyxd committed Dec 17, 2023
1 parent 91c2e5c commit a5802c3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/site/twitch.tv/modules/sidebar-previews/SidebarCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const props = defineProps<{
instance: HookedInstance<Twitch.SidebarCardComponent>;
}>();
const SIDEBAR_PREVIEW_FALLBACK = "https://vod-secure.twitch.tv/_404/404_processing_320x180.png";
const showPreviews = useConfig<boolean>("ui.sidebar_previews");
const tooltipContent = ref<ReactExtended.ReactRuntimeElement>();
Expand Down Expand Up @@ -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),
},
},
});
Expand Down

0 comments on commit a5802c3

Please sign in to comment.