Fix import graphene accounts

This commit is contained in:
hvarona 2018-11-12 22:11:14 -04:00
parent 14a405f67c
commit 0126d6d114
2 changed files with 8 additions and 4 deletions

View file

@ -146,7 +146,8 @@ public class BitsharesAccountManager implements CryptoAccountManager, CryptoNetI
GrapheneAccount fetch = (GrapheneAccount) answer; GrapheneAccount fetch = (GrapheneAccount) answer;
grapheneAccount.setName(fetch.getName()); grapheneAccount.setName(fetch.getName());
CrystalDatabase db = CrystalDatabase.getAppDatabase(context); 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)); db.grapheneAccountInfoDao().insertGrapheneAccountInfo(new GrapheneAccountInfo(grapheneAccount));
subscribeBitsharesAccount(grapheneAccount.getId(),grapheneAccount.getAccountId(),context); subscribeBitsharesAccount(grapheneAccount.getId(),grapheneAccount.getAccountId(),context);
} }
@ -158,7 +159,8 @@ public class BitsharesAccountManager implements CryptoAccountManager, CryptoNetI
}); });
}else { }else {
CrystalDatabase db = CrystalDatabase.getAppDatabase(context); 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)); db.grapheneAccountInfoDao().insertGrapheneAccountInfo(new GrapheneAccountInfo(grapheneAccount));
subscribeBitsharesAccount(grapheneAccount.getId(), grapheneAccount.getAccountId(), context); subscribeBitsharesAccount(grapheneAccount.getId(), grapheneAccount.getAccountId(), context);
} }

View file

@ -99,7 +99,8 @@ public class SteemAccountManager implements CryptoAccountManager, CryptoNetInfoR
GrapheneAccount fetch = (GrapheneAccount) answer; GrapheneAccount fetch = (GrapheneAccount) answer;
grapheneAccount.setName(fetch.getName()); grapheneAccount.setName(fetch.getName());
CrystalDatabase db = CrystalDatabase.getAppDatabase(context); 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)); db.grapheneAccountInfoDao().insertGrapheneAccountInfo(new GrapheneAccountInfo(grapheneAccount));
subscribeSteemAccount(grapheneAccount.getId(),grapheneAccount.getAccountId(),context); subscribeSteemAccount(grapheneAccount.getId(),grapheneAccount.getAccountId(),context);
} }
@ -111,7 +112,8 @@ public class SteemAccountManager implements CryptoAccountManager, CryptoNetInfoR
}); });
}else { }else {
CrystalDatabase db = CrystalDatabase.getAppDatabase(context); 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)); db.grapheneAccountInfoDao().insertGrapheneAccountInfo(new GrapheneAccountInfo(grapheneAccount));
subscribeSteemAccount(grapheneAccount.getId(), grapheneAccount.getAccountId(), context); subscribeSteemAccount(grapheneAccount.getId(), grapheneAccount.getAccountId(), context);
} }