diff --git a/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java b/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java index 55ae8db..65e3aea 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java +++ b/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java @@ -112,7 +112,6 @@ public class BitsharesAccountManager implements CryptoAccountManager, CryptoNetI @Override public void importAccountFromSeed(CryptoNetAccount account, final Context context) { - if(account instanceof GrapheneAccount) { final GrapheneAccount grapheneAccount = (GrapheneAccount) account; @@ -123,7 +122,8 @@ public class BitsharesAccountManager implements CryptoAccountManager, CryptoNetI GrapheneAccount fetch = (GrapheneAccount) answer; grapheneAccount.setAccountId(fetch.getAccountId()); CrystalDatabase db = CrystalDatabase.getAppDatabase(context); - db.cryptoNetAccountDao().insertCryptoNetAccount(grapheneAccount); + long[] idAccount = db.cryptoNetAccountDao().insertCryptoNetAccount(grapheneAccount); + grapheneAccount.setId(idAccount[0]); db.grapheneAccountInfoDao().insertGrapheneAccountInfo(new GrapheneAccountInfo(grapheneAccount)); subscribeBitsharesAccount(grapheneAccount.getId(),grapheneAccount.getAccountId(),context); } diff --git a/app/src/main/java/cy/agorise/crystalwallet/manager/FileBackupManager.java b/app/src/main/java/cy/agorise/crystalwallet/manager/FileBackupManager.java index e2db201..fe66761 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/manager/FileBackupManager.java +++ b/app/src/main/java/cy/agorise/crystalwallet/manager/FileBackupManager.java @@ -252,6 +252,8 @@ public class FileBackupManager implements FileServiceRequestsListener { account.setName(validatorRequest.getAccountName()); BitsharesAccountManager bManger = new BitsharesAccountManager(); bManger.importAccountFromSeed(account,request.getContext()); + + request.setStatus(ImportBackupRequest.StatusCode.SUCCEEDED); }else{ request.setStatus(ImportBackupRequest.StatusCode.FAILED); //TODO reason couldn't insert seed diff --git a/app/src/main/java/cy/agorise/crystalwallet/views/CryptoNetBalanceViewHolder.java b/app/src/main/java/cy/agorise/crystalwallet/views/CryptoNetBalanceViewHolder.java index 1753a02..bf1d66e 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/views/CryptoNetBalanceViewHolder.java +++ b/app/src/main/java/cy/agorise/crystalwallet/views/CryptoNetBalanceViewHolder.java @@ -187,7 +187,7 @@ public class CryptoNetBalanceViewHolder extends RecyclerView.ViewHolder { * Binds this view with the data of an element of the list */ public void bindTo(final CryptoNetBalance balance) { - if (balance == null){ + if (balance == null ){ cryptoNetName.setText("loading..."); } else { final CryptoNetBalanceViewHolder thisViewHolder = this;