Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
csenet committed Apr 28, 2024
1 parent b262c92 commit 1545171
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions frontend/dashboard/src/components/mapview/mapview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function MapView() {
const { data: points, refetch: refetchPoints } = useSuspenseQuery(getPointStates.useQuery({}));
const { mutate: mutatePoints } = useMutation(updatePointState.useMutation({}));
const { data: trains } = useSuspenseQuery(getTrains.useQuery({}));
const { mutate: mutateTrain } = useMutation(addTrain.useMutation({}));
// const { mutate: mutateTrain } = useMutation(addTrain.useMutation({}));
const { data: blocks } = useSuspenseQuery(getBlockStates.useQuery({}));
const { mutate: mutateBlock } = useMutation(updateBlockState.useMutation({}))

Expand All @@ -63,16 +63,16 @@ function MapView() {
}
return s === BlockStateEnum.BLOCK_STATE_CLOSE;
}
const nextLocation = (train: TrainPB): TrainPB | undefined => {
const current = train.positionId;
LOCATIONS_FOR_TRAIN_FROM_ID.forEach((_, key) => {
if (key === current) {
const next = LOCATIONS_FOR_TRAIN_FROM_ID.keys().next().value;
return { ...train, positionId: next };
}
});
return undefined
}
// const nextLocation = (train: TrainPB): TrainPB | undefined => {
// const current = train.positionId;
// LOCATIONS_FOR_TRAIN_FROM_ID.forEach((_, key) => {
// if (key === current) {
// const next = LOCATIONS_FOR_TRAIN_FROM_ID.keys().next().value;
// return { ...train, positionId: next };
// }
// });
// return undefined
// }
return (
<>
{/* <button onClick={() => mutateTrain({ train: { trainId: "test", positionId: "shinjyuku_up_s1" } })}>Add Train</button>
Expand Down

0 comments on commit 1545171

Please sign in to comment.