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( ...@@ -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 =
.doAfterNext { restoreModel.sub = it } fetchDeal.flatMap { fetchedDealViewState ->
.map<DealScreenViewState> { DealScreenViewState.SubscriptionStatus(it.state) } interactor.getSubscriptions(
.startWith(Observable.just<DealScreenViewState>(DealScreenViewState.Idle())) (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) val onStartTours = intent(DealScreen::tourCardClicked)
......
...@@ -52,11 +52,9 @@ ...@@ -52,11 +52,9 @@
<ImageView <ImageView
android:id="@+id/back_cross" android:id="@+id/back_cross"
android:layout_width="24dp" android:layout_width="32dp"
android:layout_height="24dp" android:layout_height="32dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:layout_marginBottom="4dp"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:tint="@color/colorGray" 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