Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invest powerdown notify #561

Merged
merged 22 commits into from
Sep 1, 2017

Conversation

zobroj
Copy link
Contributor

@zobroj zobroj commented Aug 25, 2017

Ready to merge.
This PR:

@zobroj zobroj requested a review from johannbarbie August 25, 2017 17:53
@sunify
Copy link
Contributor

sunify commented Aug 28, 2017

Suddenly, i was starting to working on this issue in Saturday before you assign yourself to it. Today i commited my fix and notice that you always working on it too :-)

Anyway, i have the solution for BigNumber limitation in my commit, so feel free to use it if you think it's ok https://github.com/sunify/ab-web/commit/dae3787920304ce9ae7108ded6cb754c120ad9ea

@zobroj
Copy link
Contributor Author

zobroj commented Aug 29, 2017

@sunify Wow, funny timing. However, @johannbarbie helped me by suggesting to convert the numbers toString():

const validate = (values, props) => {
  const errors = {};
  const { maxAmount, minAmount = 0 } = props;
  const amount = values.get('amount');
  const stringMaxAmount = new BigNumber(maxAmount.toString());
  const stringAmount = amount ? new BigNumber(amount) : '0';

  if (!amount) {
    errors.amount = <FormattedMessage {...messages.amountRequired} />;
  }
  if (amount <= minAmount) {
    errors.amount = <FormattedMessage {...messages.amountTooLow} values={{ minAmount }} />;
  }
  if (amount === 0) {
    errors.amount = <FormattedMessage {...messages.amountZero} />;
  }
  if (stringMaxAmount && stringMaxAmount.lt(stringAmount)) {
    errors.amount = <FormattedMessage {...messages.amountTooHigh} values={{ maxAmount }} />;
  }

  return errors;
};

@zobroj zobroj changed the title [WIP] Invest powerdown notify Invest powerdown notify Aug 29, 2017
zobroj added 3 commits August 30, 2017 13:13
# Conflicts:
#	app/components/ExchangeDialog/index.js
#	app/containers/Dashboard/index.js
#	app/containers/Notifications/sagas.js
@zobroj zobroj force-pushed the invest-powerdown-notify branch from e848a7b to e815404 Compare August 31, 2017 08:48
@zobroj
Copy link
Contributor Author

zobroj commented Aug 31, 2017

@sunify it seems that after a user powerUp's there isn't a second action dispatched. So now there is no way to dismiss the notification after a successful transaction.

@sunify
Copy link
Contributor

sunify commented Sep 1, 2017

@VonIobro do you mean CONTRACT_EVENT action? It should be dispatched (if tx is successful ofc).

Anyway in #585 i added new actions for transactions, so we don't need events for this purpose anymore

@johannbarbie johannbarbie merged commit 7147828 into acebusters:develop Sep 1, 2017
@johannbarbie johannbarbie deleted the invest-powerdown-notify branch September 1, 2017 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants