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