Commit aa857e0f authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

change dealId to estate_id

parent d4a2cfcb
...@@ -69,7 +69,7 @@ class SubscriptionUseCase @Inject constructor( ...@@ -69,7 +69,7 @@ class SubscriptionUseCase @Inject constructor(
var title = SubscriptionTopic.titleByTopic(sub.topic) var title = SubscriptionTopic.titleByTopic(sub.topic)
if (sub.topic is SubscriptionTopic.Deals){ if (sub.topic is SubscriptionTopic.Deals){
val deal = val deal =
user.deals?.firstOrNull { d->d.id == sub.topic.topicId } as DealEntity user.deals?.firstOrNull { d->d.estateCrmId == sub.topic.topicId } as DealEntity
title = "$title № ${deal.estate.number}" title = "$title № ${deal.estate.number}"
} }
TitledSubscriptionModel(title,sub) TitledSubscriptionModel(title,sub)
......
...@@ -147,7 +147,6 @@ class AlbumsScreenController : ...@@ -147,7 +147,6 @@ class AlbumsScreenController :
else silentCheck = false else silentCheck = false
silentCheck silentCheck
} }
.doOnNext { }
.debounce(600L, TimeUnit.MILLISECONDS) .debounce(600L, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.share() .share()
......
...@@ -165,8 +165,7 @@ class DealScreenController : ...@@ -165,8 +165,7 @@ class DealScreenController :
else silentCheck = false else silentCheck = false
silentCheck silentCheck
} }
.doOnNext { } .debounce(400L, TimeUnit.MILLISECONDS)
.debounce(600L, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
......
...@@ -44,7 +44,7 @@ class DealScreenPresenter @Inject constructor( ...@@ -44,7 +44,7 @@ class DealScreenPresenter @Inject constructor(
.doOnNext { restoreModel.deal = it } .doOnNext { restoreModel.deal = it }
.map<DealScreenViewState>{ deal -> .map<DealScreenViewState>{ deal ->
DealScreenViewState.LoadDeal(deal ,interactor.getStatusListSync()) DealScreenViewState.LoadDeal(deal ,interactor.getStatusListSync())
} }.share()
val setRead = interactor.setDealRead(dealId) val setRead = interactor.setDealRead(dealId)
...@@ -63,10 +63,15 @@ class DealScreenPresenter @Inject constructor( ...@@ -63,10 +63,15 @@ class DealScreenPresenter @Inject constructor(
.onErrorReturn { DealScreenViewState.SubscriptionError(!newState) } .onErrorReturn { DealScreenViewState.SubscriptionError(!newState) }
} }
val fetchSubscription = interactor.getSubscriptions(dealId) val fetchSubscription =
fetchDeal.flatMap { fetchedDealViewState ->
interactor.getSubscriptions(
(fetchedDealViewState as DealScreenViewState.LoadDeal).estate.estate_id
)
.doAfterNext { restoreModel.sub = it } .doAfterNext { restoreModel.sub = it }
.map<DealScreenViewState> { DealScreenViewState.SubscriptionStatus(it.state) } .map<DealScreenViewState> { DealScreenViewState.SubscriptionStatus(it.state) }
.startWith(Observable.just<DealScreenViewState>(DealScreenViewState.Idle())) .startWith(Observable.just<DealScreenViewState>(DealScreenViewState.Idle()))
}
val onStartTours = intent(DealScreen::tourCardClicked) val onStartTours = intent(DealScreen::tourCardClicked)
......
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