-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modify function definitions #1217
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good otherwise
frontend/src/components/Displays/MissionDisplays/MissionStatusDisplay.tsx
Outdated
Show resolved
Hide resolved
frontend/src/components/Pages/MissionPage/TaskOverview/TaskStatusDisplay.tsx
Outdated
Show resolved
Hide resolved
frontend/src/components/Pages/MissionPage/VideoStream/VideoPlayerOvenPlayer.tsx
Outdated
Show resolved
Hide resolved
frontend/src/components/Pages/MissionPage/MissionHeader/MissionHeader.tsx
Outdated
Show resolved
Hide resolved
frontend/src/components/Pages/MissionPage/VideoStream/VideoStreamWindow.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, the comment is very minor and can be ignored if you want, to be honest
@@ -51,9 +51,7 @@ export function RobotStatusSection() { | |||
}, [enabledRobots, installationCode, switchSafeZoneStatus]) | |||
|
|||
const getRobotDisplay = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be a function?
const getRobotDisplay = () => { | |
const robotDisplay = robots.map((robot) => <RobotStatusCard key={robot.id} robot={robot} />) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general if a local function has no arguments (or if the argument values never change) and no side effects, then it can be safely made into a variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are several like this so I suggest fixing them in separate PR
@@ -67,7 +67,7 @@ export function MissionMapView({ mission }: MissionProps) { | |||
} | |||
|
|||
const findCurrentTaskOrder = useCallback(() => { | |||
mission.tasks.forEach(function (task) { | |||
mission.tasks.forEach((task) => { | |||
if (task.status === TaskStatus.InProgress || task.status === TaskStatus.Paused) { | |||
setCurrentTaskOrder(task.taskOrder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated to your PR, but this isn't necessarily safe. Sorry you can ignore this comment, this is moreso a reminder to myself :)
No description provided.