diff --git a/front-end/src/seasons/fgc-2024/nexus-sheets/nexus-scoresheet.tsx b/front-end/src/seasons/fgc-2024/nexus-sheets/nexus-scoresheet.tsx index 0bf684a7..d0a61dc3 100644 --- a/front-end/src/seasons/fgc-2024/nexus-sheets/nexus-scoresheet.tsx +++ b/front-end/src/seasons/fgc-2024/nexus-sheets/nexus-scoresheet.tsx @@ -113,7 +113,6 @@ const NexusScoresheet: React.FC = ({ alliance: Alliance, goal: keyof AllianceNexusGoalState ) => { - console.log(allowForceRelease); if (!allowForceRelease) return; // create packet to send to FCS const packetOn: FieldControlUpdatePacket = { hubs: {}, wleds: {} }; @@ -145,10 +144,17 @@ const NexusScoresheet: React.FC = ({ // send on packet to FCS sendFCSPacket(packetOn); + // filter out any previous requests for this goal + cancelQueue.current = cancelQueue.current.filter( + (c) => !(c.alliance === alliance && c.goal === goal) + ); + // add packetoff socket request to cancel queue cancelQueue.current.push({ time: Date.now() + 3000, - callback: () => sendFCSPacket(packetOff) + callback: () => sendFCSPacket(packetOff), + alliance, + goal }); }; @@ -506,18 +512,20 @@ const GoalToggle: React.FC = ({ {NexusGoalState.Produced === state && allowForceRelease && matchState < MatchState.MATCH_COMPLETE && ( - + )} @@ -527,7 +535,7 @@ const GoalToggle: React.FC = ({ width: '100%', border: matchState === MatchState.MATCH_IN_PROGRESS && - state === NexusGoalState.Produced + state === NexusGoalState.Produced ? '5px dashed orange' : undefined }} diff --git a/front-end/src/seasons/fgc-2024/referee/TeleOpScoreSheet.tsx b/front-end/src/seasons/fgc-2024/referee/TeleOpScoreSheet.tsx index a30622a9..65c45634 100644 --- a/front-end/src/seasons/fgc-2024/referee/TeleOpScoreSheet.tsx +++ b/front-end/src/seasons/fgc-2024/referee/TeleOpScoreSheet.tsx @@ -146,7 +146,7 @@ const TeleScoreSheet: FC = ({ textAlign='center' sx={{ textTransform: 'capitalize' }} > - {alliance} Resevoir Scored + {alliance === 'red' ? 'Blue' : 'Red'} Resevoir Scored