team update
This commit is contained in:
parent
3fcbedb5e3
commit
17c2c9708c
@ -4,22 +4,6 @@ const toast = require('izitoast');
|
||||
|
||||
const actions = require('./../actions');
|
||||
|
||||
const balanceError = () =>
|
||||
toast.error({
|
||||
theme: 'dark',
|
||||
color: 'black',
|
||||
timeout: false,
|
||||
drag: false,
|
||||
position: 'center',
|
||||
maxWidth: window.innerWidth / 2,
|
||||
close: false,
|
||||
buttons: [
|
||||
['<button type="submit">OK</button>',
|
||||
(instance, thisToast) => instance.hide({ transitionOut: 'fadeOut' }, thisToast)],
|
||||
],
|
||||
message: 'Insufficient Balance',
|
||||
});
|
||||
|
||||
const addState = connect(
|
||||
function receiveState(state) {
|
||||
const {
|
||||
@ -40,8 +24,7 @@ const addState = connect(
|
||||
},
|
||||
|
||||
function receiveDispatch(dispatch) {
|
||||
function setMtxActive(mtx, balance) {
|
||||
if (balance === 0) return balanceError();
|
||||
function setMtxActive(mtx) {
|
||||
dispatch(actions.setConstructRename(null));
|
||||
dispatch(actions.setMtxActive(mtx));
|
||||
return true;
|
||||
@ -64,7 +47,7 @@ function Inventory(args) {
|
||||
if (!shop) return false;
|
||||
|
||||
const useMtx = (item, i) => (
|
||||
<figure key={i} onClick={() => setMtxActive(item, account.balance)} >
|
||||
<figure key={i} onClick={() => setMtxActive(item)} >
|
||||
<figcaption>{item}</figcaption>
|
||||
<button>¤1</button>
|
||||
</figure>
|
||||
|
||||
@ -184,7 +184,7 @@ impl Connection {
|
||||
Ok(RpcMessage::ConstructSpawn(mtx::new_construct(&mut tx, account)?)),
|
||||
|
||||
RpcRequest::MtxConstructApply { mtx, construct_id, name } =>
|
||||
Ok(RpcMessage::AccountConstructs(mtx::apply(&mut tx, account, mtx, construct_id, name)?)),
|
||||
Ok(RpcMessage::AccountTeam(mtx::apply(&mut tx, account, mtx, construct_id, name)?)),
|
||||
|
||||
RpcRequest::MtxBuy { mtx } =>
|
||||
Ok(RpcMessage::AccountShop(mtx::buy(&mut tx, account, mtx)?)),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user