hivewallet / hiveapp-bitstamptrader

Hive application for Bitstamp trading
MIT License
1 stars 3 forks source link

Fix some bugs and add workaround for Hive Android API limits #9

Closed javgh closed 10 years ago

javgh commented 10 years ago

Please review, merge and tag as 1.2.3 . This contains commits for:

  1. Workaround for the current limit, that the Hive Android API is only available on the first page.
  2. Correctly display USD balance - a commit a while back introduced a bug, where the balance would typically end up being shown as zero all the time.
  3. Moves some code that depends on the result of getUserInfo() into the callback, so that it is guaranteed, that the data will be available.

Regarding 3):

The app was doing something like this:

var user_address;
bitcoin.getUserInfo(function(info){
  user_address = info.address;
});
alert(user_address);

It seems, that on Hive OSX the getUserInfo() call completes quickly enough, that this will work anyway. On Hive Android the asynchronous callback will usually be executed later though. So the alert() needs to be moved into the callback, to ensure proper ordering. If other apps also rely on this behavior, they will need to be fixed as well. But I haven't checked specifically yet.

weilu commented 10 years ago

Tagged. It should be available on app store for update now. Thanks @javgh @jsuder