issues fixed

This commit is contained in:
pauladamseniii
2023-10-18 14:51:05 -04:00
parent dd0bce2f5d
commit 8aa80ec207
6 changed files with 69 additions and 29 deletions

View File

@@ -57,6 +57,7 @@ export const CarUpdatesProvider = ({ children }) => {
const [carUpdates, setCarUpdates] = useState([]);
const [versions, setVersions] = useState([SELECT_VERSION_OBJ]);
const [versionRxSwins, setVersionRxSwins] = useState([]);
const [totalVersionRxSwins, setTotalVersionRxSwins] = useState(0);
const [totalCarUpdates, setTotalCarUpdates] = useState(0);
const [delayCount, setDelayCount] = useState(0);
let progressTimer = 0;
@@ -308,17 +309,20 @@ export const CarUpdatesProvider = ({ children }) => {
return result;
};
const getSUMSVersionRxSwins = async (sums_version, token) => {
const getSUMSVersionRxSwins = async (sums_version, options, token) => {
let result;
try {
setBusy(true);
result = await api.getSUMSVersionRxSwins(sums_version, token);
result = await api.getSUMSVersionRxSwins(sums_version, options, token);
if (result.error)
throw new Error(`Get software version rxswins error. ${result.message}`);
setVersionRxSwins(result.data);
if (options && options.offset === 0 && result.total) {
setTotalVersionRxSwins(result.total);
}
} finally {
setBusy(false);
}
@@ -374,6 +378,7 @@ export const CarUpdatesProvider = ({ children }) => {
stopMonitor,
updateSUMSVersion,
getSUMSVersionRxSwins,
totalVersionRxSwins,
deleteSUMSVersionRxSwins,
addSUMSVersionRxSwins,
}}