mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix display of control points.
Apparently redux state objects *must* be objects.
This commit is contained in:
parent
dba2699b7e
commit
1cd77a4a77
@ -3,14 +3,20 @@ import { PayloadAction, createSlice } from "@reduxjs/toolkit";
|
||||
import { ControlPoint } from "./controlpoint";
|
||||
import { RootState } from "../app/store";
|
||||
|
||||
const initialState: ControlPoint[] = [];
|
||||
interface ControlPointsState {
|
||||
controlPoints: ControlPoint[];
|
||||
}
|
||||
|
||||
const initialState: ControlPointsState = {
|
||||
controlPoints: [],
|
||||
};
|
||||
|
||||
export const controlPointsSlice = createSlice({
|
||||
name: "controlPoints",
|
||||
initialState,
|
||||
reducers: {
|
||||
setControlPoints: (state, action: PayloadAction<ControlPoint[]>) => {
|
||||
state = action.payload;
|
||||
state.controlPoints = action.payload;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@ -7,7 +7,7 @@ export default function ControlPointsLayer() {
|
||||
const controlPoints = useAppSelector(selectControlPoints);
|
||||
return (
|
||||
<LayerGroup>
|
||||
{controlPoints.map((controlPoint) => {
|
||||
{controlPoints.controlPoints.map((controlPoint) => {
|
||||
return (
|
||||
<ControlPoint key={controlPoint.name} controlPoint={controlPoint} />
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user