Web: refactoring

This commit is contained in:
Alexey Safronov 2023-03-31 11:55:44 +04:00
parent 772fa1d3dc
commit 2bfc53b881

View File

@ -23,25 +23,18 @@ class SecondaryProgressDataStore {
if (progressIndex !== -1) {
this.secondaryOperationsArray[progressIndex] = secondaryProgressData;
}
if (progressIndex === 0) {
const progressDataItems = Object.keys(secondaryProgressData);
for (let key of progressDataItems) {
if (key in this) {
this[key] = secondaryProgressData[key];
}
}
}
} else {
if (this.secondaryOperationsArray.length === 0) {
const progressDataItems = Object.keys(secondaryProgressData);
for (let key of progressDataItems) {
if (key in this) {
this[key] = secondaryProgressData[key];
}
if (progressIndex === 0 || this.secondaryOperationsArray.length === 0) {
const progressDataItems = Object.keys(secondaryProgressData);
for (let key of progressDataItems) {
if (key in this) {
this[key] = secondaryProgressData[key];
}
}
}
if (progressIndex === -1) {
this.secondaryOperationsArray.push(secondaryProgressData);
}
};