diff --git a/packages/client/src/components/preview/IndicatorSet.svelte b/packages/client/src/components/preview/IndicatorSet.svelte index a6ca57aef0..c33ea606ff 100644 --- a/packages/client/src/components/preview/IndicatorSet.svelte +++ b/packages/client/src/components/preview/IndicatorSet.svelte @@ -13,9 +13,11 @@ let indicators = [] let interval let text + let icon + $: visibleIndicators = indicators.filter(x => x.visible) $: offset = $builderStore.inBuilder ? 0 : 2 - $: icon = getComponentIcon(componentId) + $: getComponentIcon(componentId) let updating = false let observers = [] @@ -24,12 +26,14 @@ const getComponentIcon = id => { if (!id) { - return null + return } const component = componentStore.actions.getComponentById(id) const type = component?._component const definition = componentStore.actions.getComponentDefinition(type) - return definition?.icon + if (definition?.icon) { + icon = definition.icon + } } const createIntersectionCallback = idx => entries => { @@ -68,6 +72,9 @@ if (prefix) { text = `${prefix} ${text}` } + if (parents[0].dataset.icon) { + icon = parents[0].dataset.icon + } } // Batch reads to minimize reflow