feat(redux): Rename all Redux slices and store keys to match file names for clarity
- Renamed all slice names (createSlice `name` attribute) to match their file names (e.g. loopChartSlice, authSlice, kueDataSlice etc.) - Updated `store.ts` to register each reducer with consistent key names (e.g. state.loopChartSlice instead of state.loopChart) - Adjusted all `useSelector` and Redux state accesses across the codebase - Improves maintainability, searchability and consistency across files and Redux DevTools
This commit is contained in:
@@ -20,16 +20,16 @@ const TDRChart: React.FC<{ isFullScreen: boolean }> = ({ isFullScreen }) => {
|
||||
|
||||
// 🟢 **Hole den ausgewählten Slot und Messkurve aus Redux**
|
||||
const selectedId = useSelector(
|
||||
(state: RootState) => state.tdrDataById.selectedId
|
||||
(state: RootState) => state.tdrDataByIdSlice.selectedId
|
||||
);
|
||||
const selectedSlot = useSelector(
|
||||
(state: RootState) => state.kueChartMode.selectedSlot
|
||||
(state: RootState) => state.kueChartModeSlice.selectedSlot
|
||||
);
|
||||
const selectedChartType = useSelector(
|
||||
(state: RootState) => state.kueChartMode.activeMode
|
||||
(state: RootState) => state.kueChartModeSlice.activeMode
|
||||
);
|
||||
const tdrDataById = useSelector(
|
||||
(state: RootState) => state.tdrDataById.dataById
|
||||
(state: RootState) => state.tdrDataByIdSlice.dataById
|
||||
);
|
||||
//--------------------------------
|
||||
const tdrInitialData =
|
||||
@@ -46,7 +46,7 @@ const TDRChart: React.FC<{ isFullScreen: boolean }> = ({ isFullScreen }) => {
|
||||
//--------------------------------
|
||||
const referenceChartData = useSelector((state: RootState) =>
|
||||
selectedSlot !== null
|
||||
? state.tdrReferenceChartDataBySlot.referenceData[selectedSlot] || []
|
||||
? state.tdrReferenceChartDataBySlotSlice.referenceData[selectedSlot] || []
|
||||
: []
|
||||
);
|
||||
//--------------------------------
|
||||
@@ -58,7 +58,7 @@ const TDRChart: React.FC<{ isFullScreen: boolean }> = ({ isFullScreen }) => {
|
||||
|
||||
//--------------------------------
|
||||
const tdmChartData = useSelector(
|
||||
(state: RootState) => state.tdmSingleChart.data
|
||||
(state: RootState) => state.tdmSingleChartSlice.data
|
||||
);
|
||||
const pinDistance =
|
||||
selectedId !== null && Array.isArray(tdmChartData?.[selectedSlot ?? -1])
|
||||
|
||||
Reference in New Issue
Block a user