Skip to content

Open-source status page, incident response and uptime monitoring

fix: status-bar pin regression (#2135)

Maximilian Kaskec8ac2355a10b
diff --git a/packages/ui/src/components/blocks/status-bar.tsx b/packages/ui/src/components/blocks/status-bar.tsx
index 6f7fd9cf9..2dc26d466 100644
--- a/packages/ui/src/components/blocks/status-bar.tsx
+++ b/packages/ui/src/components/blocks/status-bar.tsx
@@ -147,11 +147,16 @@ function useStatusBar({ dataLength, isTouch }: UseStatusBarProps) {
}
}, []);
+ const interactionTypeRef = useRef<InteractionType>(null);
+ useEffect(() => {
+ interactionTypeRef.current = interactionType;
+ }, [interactionType]);
+
const handleClick = useCallback(
(index: number) => {
clearHoverTimeout();
setActiveIndex((prev) => {
- if (prev === index) {
+ if (prev === index && interactionTypeRef.current === "pin") {
setInteractionType(null);
return null;
}