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