Skip to content

Commit daf74fc

Browse files
committed
wrote a better solution
Signed-off-by: antedotee <[email protected]>
1 parent bb6e478 commit daf74fc

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

frontend/src/components/wds_topology/ZoomControls.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,10 @@ export const ZoomControls = memo<ZoomControlsProps>(
7373
const [zoomLevel, setZoomLevel] = useState<number>(120);
7474
const [presetMenuAnchor, setPresetMenuAnchor] = useState<null | HTMLElement>(null);
7575
const [hoveredButton, setHoveredButton] = useState<string | null>(null);
76-
const [showControls, setShowControls] = useState<boolean>(() => {
77-
const saved = localStorage.getItem('wds-show-controls');
78-
return saved ? JSON.parse(saved) : false; // Default to false (controls hidden)
79-
});
76+
const [showControls, setShowControls] = useState<boolean>(false); // Controls hidden by default
8077

8178
const toggleControls = () => {
82-
setShowControls(prev => {
83-
const newValue = !prev;
84-
localStorage.setItem('wds-show-controls', JSON.stringify(newValue));
85-
return newValue;
86-
});
79+
setShowControls(prev => !prev);
8780
};
8881
const { setZoom } = useZoomStore();
8982
const { edgeType, setEdgeType } = useEdgeTypeStore();

0 commit comments

Comments
 (0)