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

Merge branch 'feature/subs_fix' into develop

parents d4a2cfcb 0e15df88
......@@ -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)
......
......@@ -52,11 +52,9 @@
<ImageView
android:id="@+id/back_cross"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginTop="4dp"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="4dp"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
android:tint="@color/colorGray"
......
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