mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 17:40:46 -04:00
hud adjustments
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// Drive Dock Action
|
||||
// Purpose: Defines the Drive Dock Action module and the local helpers/components used in this file.
|
||||
// Scope: Keeps behavior unchanged while isolating this concern into a clear, single-responsibility unit.
|
||||
import { useMemo, useState } from 'react';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { useControlSystem } from '../../controls/index.js';
|
||||
import { useTelemetryFrame } from '../../context/TelemetryContext.jsx';
|
||||
import { formatKeyLabel } from '../../controls/keymapUtils.js';
|
||||
@@ -138,6 +138,12 @@ export default function DriveDockAction({
|
||||
const chargeValue = charging ? 'Charging' : docked ? 'Charging soon...' : '—';
|
||||
const chargeTone = charging ? 'good' : docked ? 'warn' : 'bad';
|
||||
|
||||
useEffect(() => {
|
||||
if (!manualAssistActive) return;
|
||||
if (!docked) return;
|
||||
actions.setManualDockAssistActive(false);
|
||||
}, [actions, docked, manualAssistActive]);
|
||||
|
||||
const handleReturnToDrive = async () => {
|
||||
if (!roverId || pending) return;
|
||||
setPending('drive');
|
||||
|
||||
Reference in New Issue
Block a user