急停 发送ws 遥感控制 避免 raf循环闭包

This commit is contained in:
mmc
2026-10-15 14:02:02 +08:00
parent 4e1356b8af
commit 652dbdcc78
6 changed files with 46 additions and 3 deletions

View File

@@ -671,6 +671,7 @@ export default function DeviceStatusPage() {
}, [device, uavState, currentDroneData]);
const handleGamepadUpdate = useCallback((state) => {
console.log('handleGamepadUpdate called with state:', isControlled);
// 无控制权限时:不发送消息,且只发起一次权限申请(避免手柄/方向盘高频更新刷屏)
if (!isControlled) {
if (!hasRequestedControlRef.current && !connecting) {