Skip to content
Snippets Groups Projects
Commit 476417ae authored by lowercasedonkey's avatar lowercasedonkey
Browse files

prevent overspending

parent 996dc853
Branches
Tags
1 merge request!7504Wardrobe shopping to DOM
......@@ -128,8 +128,10 @@ App.UI.WardrobeShopping = function() {
App.UI.DOM.link(
`Order ${clothingObj.title}`,
() => {
cashX(forceNeg(cost), "capEx");
V.boughtItem.clothing[clothing] = 1;
if (cost < V.cash) { // Check again on click in case the link has become stale
cashX(forceNeg(cost), "capEx");
V.boughtItem.clothing[clothing] = 1;
}
}
)
);
......@@ -180,8 +182,10 @@ App.UI.WardrobeShopping = function() {
App.UI.DOM.link(
`Order ${obj.title}`,
() => {
cashX(forceNeg(cost), "capEx");
_.set(V.boughtItem, name, 1);
if (cost < V.cash) { // Check again on click in case the link has become stale
cashX(forceNeg(cost), "capEx");
_.set(V.boughtItem, name, 1);
}
jQuery(`#accessory-block`).empty().append(accessoryBlock());
}
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment