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:
@@ -29,35 +29,37 @@ function SettingModal({ showModal, onClose }) {
|
||||
const [showLoginForm, setShowLoginForm] = useState(false);
|
||||
|
||||
const deviceName_Redux = useSelector(
|
||||
(state: RootState) => state.systemSettings.deviceName
|
||||
(state: RootState) => state.systemSettingsSlice.deviceName
|
||||
);
|
||||
const mac1_Redux = useSelector(
|
||||
(state: RootState) => state.systemSettings.mac1
|
||||
(state: RootState) => state.systemSettingsSlice.mac1
|
||||
);
|
||||
const ip_Redux = useSelector(
|
||||
(state: RootState) => state.systemSettingsSlice.ip
|
||||
);
|
||||
const ip_Redux = useSelector((state: RootState) => state.systemSettings.ip);
|
||||
const subnet_Redux = useSelector(
|
||||
(state: RootState) => state.systemSettings.subnet
|
||||
(state: RootState) => state.systemSettingsSlice.subnet
|
||||
);
|
||||
const gateway_Redux = useSelector(
|
||||
(state: RootState) => state.systemSettings.gateway
|
||||
(state: RootState) => state.systemSettingsSlice.gateway
|
||||
);
|
||||
const datetime_Redux = useSelector(
|
||||
(state: RootState) => state.systemSettings.cplInternalTimestamp
|
||||
(state: RootState) => state.systemSettingsSlice.cplInternalTimestamp
|
||||
);
|
||||
const ntp1_Redux = useSelector(
|
||||
(state: RootState) => state.systemSettings.ntp1
|
||||
(state: RootState) => state.systemSettingsSlice.ntp1
|
||||
);
|
||||
const ntp2_Redux = useSelector(
|
||||
(state: RootState) => state.systemSettings.ntp2
|
||||
(state: RootState) => state.systemSettingsSlice.ntp2
|
||||
);
|
||||
const ntp3_Redux = useSelector(
|
||||
(state: RootState) => state.systemSettings.ntp3
|
||||
(state: RootState) => state.systemSettingsSlice.ntp3
|
||||
);
|
||||
const ntpTimezone_Redux = useSelector(
|
||||
(state: RootState) => state.systemSettings.ntpTimezone
|
||||
(state: RootState) => state.systemSettingsSlice.ntpTimezone
|
||||
);
|
||||
const active_Redux = useSelector(
|
||||
(state: RootState) => state.systemSettings.ntpActive
|
||||
(state: RootState) => state.systemSettingsSlice.ntpActive
|
||||
);
|
||||
|
||||
const [name, setName] = useState(deviceName_Redux || "");
|
||||
|
||||
Reference in New Issue
Block a user