fix(issue9): Checks when no connector at all
This commit is contained in:
parent
1d1c626127
commit
80b074102a
@ -1583,6 +1583,26 @@ class Shop extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (idxK.length === 0) {
|
||||||
|
const slots_need_resource = itemsCloned.slice(0);
|
||||||
|
const idx_need = slots_need_resource.findIndex(e => (e.rules && e.rules.resources));
|
||||||
|
|
||||||
|
if (idx_need != -1) {
|
||||||
|
if (idx_need in itemsData) {
|
||||||
|
if ('warnings' in itemsData[idx_need]) {
|
||||||
|
itemsData[idx_need].warnings.resources = {...itemsCloned[idx_need].rules.resources};
|
||||||
|
} else {
|
||||||
|
itemsData[idx_need].warnings = {};
|
||||||
|
itemsData[idx_need].warnings.resources = {...itemsCloned[idx_need].rules.resources};
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
itemsData[idx_need] = {...itemsCloned[idx_need]};
|
||||||
|
itemsData[idx_need].warnings = {};
|
||||||
|
itemsData[idx_need].warnings.resources = {...itemsCloned[idx_need].rules.resources};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// check number of clock connector available
|
// check number of clock connector available
|
||||||
const idxC = itemsCloned.reduce((prev, next, i) => {
|
const idxC = itemsCloned.reduce((prev, next, i) => {
|
||||||
|
23
static/js/shop.min.js
vendored
23
static/js/shop.min.js
vendored
@ -1624,6 +1624,29 @@ function (_React$PureComponent12) {
|
|||||||
rules[ddkali.rules.follow.type] = _objectSpread({}, ddkali.rules.follow);
|
rules[ddkali.rules.follow.type] = _objectSpread({}, ddkali.rules.follow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (idxK.length === 0) {
|
||||||
|
var _slots_need_resource = itemsCloned.slice(0);
|
||||||
|
|
||||||
|
var _idx_need = _slots_need_resource.findIndex(function (e) {
|
||||||
|
return e.rules && e.rules.resources;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (_idx_need != -1) {
|
||||||
|
if (_idx_need in itemsData) {
|
||||||
|
if ('warnings' in itemsData[_idx_need]) {
|
||||||
|
itemsData[_idx_need].warnings.resources = _objectSpread({}, itemsCloned[_idx_need].rules.resources);
|
||||||
|
} else {
|
||||||
|
itemsData[_idx_need].warnings = {};
|
||||||
|
itemsData[_idx_need].warnings.resources = _objectSpread({}, itemsCloned[_idx_need].rules.resources);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
itemsData[_idx_need] = _objectSpread({}, itemsCloned[_idx_need]);
|
||||||
|
itemsData[_idx_need].warnings = {};
|
||||||
|
itemsData[_idx_need].warnings.resources = _objectSpread({}, itemsCloned[_idx_need].rules.resources);
|
||||||
|
}
|
||||||
|
}
|
||||||
} // check number of clock connector available
|
} // check number of clock connector available
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user