fix(sidebar): disable logo drag while bugs mode is on

This commit is contained in:
xmanrui
2026-03-02 23:17:29 +08:00
parent e0c8d932f7
commit 277391f045
+6 -2
View File
@@ -127,6 +127,10 @@ export function Sidebar() {
};
const onMouseMove = (e: MouseEvent) => {
if (!dragRef.current.active) return;
if (bugsEnabledRef.current) {
stopDrag();
return;
}
const nextDx = dragRef.current.originDx + (e.clientX - dragRef.current.startX);
const nextDy = dragRef.current.originDy + (e.clientY - dragRef.current.startY);
if (Math.abs(nextDx - dragRef.current.originDx) > 3 || Math.abs(nextDy - dragRef.current.originDy) > 3) {
@@ -153,7 +157,7 @@ export function Sidebar() {
}, []);
const handleLogoMouseDown = (e: React.MouseEvent<HTMLSpanElement>) => {
if (e.button !== 0) return;
if (e.button !== 0 || bugsEnabledRef.current) return;
e.preventDefault();
e.stopPropagation();
dragRef.current = {
@@ -182,7 +186,7 @@ export function Sidebar() {
};
const logoTransform = `translate(${manualLogoOffset.dx + logoCarry.dx}px, ${manualLogoOffset.dy + logoCarry.dy}px) rotate(${logoCarry.angle + manualLogoAngle}rad)`;
const logoCursor = isLogoDragging ? "grabbing" : "grab";
const logoCursor = !bugsEnabled ? (isLogoDragging ? "grabbing" : "grab") : "default";
return (
<>