Commit b4c7ca16 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk

fix: smart list

Sometimes smart list data was not updated. This patch fix it by
changing subscriptions.

Change-Id: Icad42975e0b74b683396adced60cbe50863459a4
parent 67180dc2
......@@ -107,10 +107,9 @@ class SmartlistViewModel: Stateable, ViewModel {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.01, execute: {
if let account = self.accountsService.currentAccount {
self.profileService.getAccountProfile(accountId: account.id)
.take(1)
.subscribe(onNext: { profile in
self.profileImageForCurrentAccount.onNext(profile)
}).disposed(by: self.disposeBag)
}).disposed(by: self.tempBag)
}
})
return profileImageForCurrentAccount.share()
......@@ -134,10 +133,9 @@ class SmartlistViewModel: Stateable, ViewModel {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.01, execute: {
self.conversationsService.conversationsForCurrentAccount
.observeOn(MainScheduler.instance)
.take(1)
.subscribe(onNext: { (conversations) in
self.conversationsForCurrentAccount.onNext(conversations)
}).disposed(by: self.disposeBag)
}).disposed(by: self.tempBag)
})
return self.conversationsForCurrentAccount.share().map({ (conversations) in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment