From 2832880d45eaf355e29edb5ba48191a016615c0a Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Thu, 21 Nov 2019 19:24:43 -0500 Subject: [PATCH] Fix: balance / bid issues Balance checking on publish was not working. Channel create didn't have minimum bid check. --- ui/component/publishName/view.jsx | 2 +- ui/component/selectChannel/view.jsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/component/publishName/view.jsx b/ui/component/publishName/view.jsx index 3030a026c..66b6d1e40 100644 --- a/ui/component/publishName/view.jsx +++ b/ui/component/publishName/view.jsx @@ -57,7 +57,7 @@ function PublishName(props: Props) { }, [name]); useEffect(() => { - const totalAvailableBidAmount = previousBidAmount + balance; + const totalAvailableBidAmount = previousBidAmount ? previousBidAmount + balance : balance; let bidError; if (bid === 0) { diff --git a/ui/component/selectChannel/view.jsx b/ui/component/selectChannel/view.jsx index a67aa41a6..09650b20a 100644 --- a/ui/component/selectChannel/view.jsx +++ b/ui/component/selectChannel/view.jsx @@ -6,7 +6,7 @@ import BusyIndicator from 'component/common/busy-indicator'; import Button from 'component/button'; import analytics from 'analytics'; -import { CHANNEL_NEW, CHANNEL_ANONYMOUS, INVALID_NAME_ERROR } from 'constants/claim'; +import { CHANNEL_NEW, CHANNEL_ANONYMOUS, MINIMUM_PUBLISH_BID, INVALID_NAME_ERROR } from 'constants/claim'; type Props = { channel: string, // currently selected channel @@ -102,6 +102,8 @@ class ChannelSection extends React.PureComponent { newChannelBidError = __('Please decrease your deposit to account for transaction fees'); } else if (newChannelBid > balance) { newChannelBidError = __('Deposit cannot be higher than your balance'); + } else if (newChannelBid < MINIMUM_PUBLISH_BID) { + newChannelBidError = __('Your deposit must be higher'); } this.setState({