This commit is contained in:
saplf
2019-09-08 21:48:48 +08:00
parent e493267a51
commit 9aa5d0d5bf
12 changed files with 88 additions and 32 deletions

View File

@@ -113,17 +113,16 @@ const model: Model = {
address,
balance,
} = (yield select((state: any) => state.draw)) as DrawModelState;
if (!coin || !balance) return;
if (!coin) return message.warn(formatMessage({ id: 'draw.coin' }));
if (!address) return message.warn(formatMessage({ id: 'draw.targetPrompt' }));
const inputAmount = new BigNumber(amount || 0);
if (inputAmount.lt(1000)) return message.warn(formatMessage({ id: 'draw.amountLt' }));
if (inputAmount.gt(balance)) return message.warn(formatMessage({ id: 'draw.amountGt' }));
if (inputAmount.gt(balance || 0)) return message.warn(formatMessage({ id: 'draw.amountGt' }));
yield put({
type: 'onUpdateState',
confirmVisible: true,
confirmLoading: false,
password: '',
})
});
},
*draw(_, { put, select, call }) {