From 0126d6d114a3839b6935ed194967702d3dc19bfa Mon Sep 17 00:00:00 2001 From: hvarona Date: Mon, 12 Nov 2018 22:11:14 -0400 Subject: [PATCH] Fix import graphene accounts --- .../crystalwallet/manager/BitsharesAccountManager.java | 6 ++++-- .../agorise/crystalwallet/manager/SteemAccountManager.java | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) 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 55cf375..62ff8ec 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java +++ b/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java @@ -146,7 +146,8 @@ public class BitsharesAccountManager implements CryptoAccountManager, CryptoNetI GrapheneAccount fetch = (GrapheneAccount) answer; grapheneAccount.setName(fetch.getName()); CrystalDatabase db = CrystalDatabase.getAppDatabase(context); - db.cryptoNetAccountDao().insertCryptoNetAccount(grapheneAccount); + long idAccount = db.cryptoNetAccountDao().insertCryptoNetAccount(grapheneAccount)[0]; + grapheneAccount.setId(idAccount); db.grapheneAccountInfoDao().insertGrapheneAccountInfo(new GrapheneAccountInfo(grapheneAccount)); subscribeBitsharesAccount(grapheneAccount.getId(),grapheneAccount.getAccountId(),context); } @@ -158,7 +159,8 @@ public class BitsharesAccountManager implements CryptoAccountManager, CryptoNetI }); }else { CrystalDatabase db = CrystalDatabase.getAppDatabase(context); - db.cryptoNetAccountDao().insertCryptoNetAccount(grapheneAccount); + long idAccount = db.cryptoNetAccountDao().insertCryptoNetAccount(grapheneAccount)[0]; + grapheneAccount.setId(idAccount); db.grapheneAccountInfoDao().insertGrapheneAccountInfo(new GrapheneAccountInfo(grapheneAccount)); subscribeBitsharesAccount(grapheneAccount.getId(), grapheneAccount.getAccountId(), context); } diff --git a/app/src/main/java/cy/agorise/crystalwallet/manager/SteemAccountManager.java b/app/src/main/java/cy/agorise/crystalwallet/manager/SteemAccountManager.java index 63d4173..8c66c29 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/manager/SteemAccountManager.java +++ b/app/src/main/java/cy/agorise/crystalwallet/manager/SteemAccountManager.java @@ -99,7 +99,8 @@ public class SteemAccountManager implements CryptoAccountManager, CryptoNetInfoR GrapheneAccount fetch = (GrapheneAccount) answer; grapheneAccount.setName(fetch.getName()); CrystalDatabase db = CrystalDatabase.getAppDatabase(context); - db.cryptoNetAccountDao().insertCryptoNetAccount(grapheneAccount); + long idAccount = db.cryptoNetAccountDao().insertCryptoNetAccount(grapheneAccount)[0]; + grapheneAccount.setId(idAccount); db.grapheneAccountInfoDao().insertGrapheneAccountInfo(new GrapheneAccountInfo(grapheneAccount)); subscribeSteemAccount(grapheneAccount.getId(),grapheneAccount.getAccountId(),context); } @@ -111,7 +112,8 @@ public class SteemAccountManager implements CryptoAccountManager, CryptoNetInfoR }); }else { CrystalDatabase db = CrystalDatabase.getAppDatabase(context); - db.cryptoNetAccountDao().insertCryptoNetAccount(grapheneAccount); + long idAccount = db.cryptoNetAccountDao().insertCryptoNetAccount(grapheneAccount)[0]; + grapheneAccount.setId(idAccount); db.grapheneAccountInfoDao().insertGrapheneAccountInfo(new GrapheneAccountInfo(grapheneAccount)); subscribeSteemAccount(grapheneAccount.getId(), grapheneAccount.getAccountId(), context); }