Skip to content
Snippets Groups Projects
Commit fa6e0e74 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk
Browse files

jams: fix save profile

When profile updated signal received, client may not have
account yet. This patch fetch account details from daemon
to save profile.

Change-Id: Ie41054f7c2c114dddf04aceea8dc0467ec4c244f
parent 0cd73b62
Branches
Tags
No related merge requests found
...@@ -850,10 +850,14 @@ class AccountsService: AccountAdapterDelegate { ...@@ -850,10 +850,14 @@ class AccountsService: AccountAdapterDelegate {
name = accountDetails.get(withConfigKeyModel: ConfigKeyModel(withKey: ConfigKey.displayName)) name = accountDetails.get(withConfigKeyModel: ConfigKeyModel(withKey: ConfigKey.displayName))
} }
guard let accountToUpdate = self.getAccount(fromAccountId: account), self.getAccountFromDaemon(fromAccountId: account)
let accountURI = AccountModelHelper .subscribe(onSuccess: { [weak self] accountToUpdate in
.init(withAccount: accountToUpdate).uri else {return} guard let self = self, let accountURI = AccountModelHelper
_ = self.dbManager.saveAccountProfile(alias: name, photo: photo, accountId: account, accountURI: accountURI) .init(withAccount: accountToUpdate).uri else {
return
}
_ = self.dbManager.saveAccountProfile(alias: name, photo: photo, accountId: account, accountURI: accountURI)
}).disposed(by: self.disposeBag)
} }
// MARK: Push Notifications // MARK: Push Notifications
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment