Commit 80becc0d authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

deals list merge

parent 0c141bec
...@@ -11,7 +11,6 @@ import com.biganto.visual.roompark.data.repository.mapper.fromRaw ...@@ -11,7 +11,6 @@ import com.biganto.visual.roompark.data.repository.mapper.fromRaw
import com.biganto.visual.roompark.data.repository.mapper.fromRawList import com.biganto.visual.roompark.data.repository.mapper.fromRawList
import com.biganto.visual.roompark.domain.contract.DealContract import com.biganto.visual.roompark.domain.contract.DealContract
import com.biganto.visual.roompark.domain.custom_exception.CustomApiException import com.biganto.visual.roompark.domain.custom_exception.CustomApiException
import com.biganto.visual.roompark.domain.model.DealModel
import com.biganto.visual.roompark.domain.model.EstateModel import com.biganto.visual.roompark.domain.model.EstateModel
import com.biganto.visual.roompark.domain.model.fromEntity import com.biganto.visual.roompark.domain.model.fromEntity
import io.reactivex.Completable import io.reactivex.Completable
...@@ -51,7 +50,6 @@ class EstateRepository @Inject constructor( ...@@ -51,7 +50,6 @@ class EstateRepository @Inject constructor(
estate.setFavorite(true) estate.setFavorite(true)
estate.user = user estate.user = user
} }
dbList dbList
.filterNotNull() .filterNotNull()
.filter { dbFav ->!apiList.map{it.id}.contains(dbFav.id) } .filter { dbFav ->!apiList.map{it.id}.contains(dbFav.id) }
...@@ -63,13 +61,8 @@ class EstateRepository @Inject constructor( ...@@ -63,13 +61,8 @@ class EstateRepository @Inject constructor(
.map { it.toList() } .map { it.toList() }
.doOnNext{ db.refreshUser(user) } .doOnNext{ db.refreshUser(user) }
override fun fetchDeals(user:UserEntity): Observable<List<EstateEntity>> = override fun fetchDeals(user:UserEntity): Observable<List<DealEntity>> =
api.getDeals(user.authToken)//api.getDeals(user.authToken) getDealsApi(user)
.doOnError(Timber::e)
.map { List(it.size){index -> fromRaw(it[index],user)} }
.flatMap(db::upsertDeals)
.map { it.map {deal -> deal.estate as EstateEntity } }
.doOnNext { db.refreshUser(user) }
private fun fetchEstateDb(id: Int) = db.getEstate(id) private fun fetchEstateDb(id: Int) = db.getEstate(id)
...@@ -80,23 +73,29 @@ class EstateRepository @Inject constructor( ...@@ -80,23 +73,29 @@ class EstateRepository @Inject constructor(
private val getDealsApi: Observable<List<DealEntity>> = override fun getDealsApi(user: UserEntity): Observable<List<DealEntity>> =
local.recentUser() Observables.zip(
.doOnError (Timber::e) api.getDeals(user.authToken)
.flatMap { .doOnError(Timber::e)
when (it) { .map { List(it.size){index -> fromRaw(it[index],user)} }
is UserState.Authenticated -> db.fetchUser(it.uuid.toInt()) ,db.getUserDeals(user.uuid)
else -> throw CustomApiException.NotAuthorizedException() .toList().toObservable()
.doOnError(Timber::e)
){apiList,dbList ->
apiList.forEach { deal ->
dbList?.firstOrNull { dbDeal-> dbDeal?.id == deal.id }?.let {
deal.setRead(it.read)
} }
deal.user = user
} }
.doOnError (Timber::e) dbList
.flatMap { user -> .filterNotNull()
api.getDeals(user.authToken)//api.getDeals(user.authToken) .filter { dbFav ->!apiList.map{it.id}.contains(dbFav.id) }
.doOnError(Timber::e) .let{ db.deleteDeal(it) }
.map { List(it.size){index -> fromRaw(it[index],user)} } return@zip apiList
.doOnNext(db::blockingUpsert) }
.doOnNext { db.refreshUser(user) } .doOnNext(db::blockingUpsert)
} .doOnNext { db.refreshUser(user) }
private val getDealsDb: Observable<List<DealEntity>> = private val getDealsDb: Observable<List<DealEntity>> =
local.recentUser() local.recentUser()
...@@ -109,21 +108,11 @@ class EstateRepository @Inject constructor( ...@@ -109,21 +108,11 @@ class EstateRepository @Inject constructor(
.map { it.deals?.map {deal -> deal as DealEntity } } .map { it.deals?.map {deal -> deal as DealEntity } }
override fun getDeals(): Observable<List<DealModel>> {
return Observable.mergeDelayError(
arrayListOf(
getDealsDb,
getDealsApi
)
)
.map { fromEntity(it, ::fromEntity) }
.doOnError(Timber::e)
.subscribeOn (Schedulers.io())
}
override fun setDealRead(dealId: String): Completable = override fun setDealRead(dealId: String): Completable =
db.setDealReadState(dealId,true) db.setDealReadState(dealId,true)
.doOnError { Timber.e(it) }
......
...@@ -66,10 +66,8 @@ class SubscriptionRepository @Inject constructor( ...@@ -66,10 +66,8 @@ class SubscriptionRepository @Inject constructor(
val newSubList = mutableListOf<SubscriptionEntity>() val newSubList = mutableListOf<SubscriptionEntity>()
apiSubs.forEach { apiSub -> apiSubs.forEach { apiSub ->
Timber.d("api sub state: ${apiSub.active}")
val cachedSub = val cachedSub =
userSubs?.firstOrNull { s -> userSubs?.firstOrNull { s ->
Timber.w("hehe ${s.topic} == ${apiSub.topic} && ${s.number} == ${apiSub.estate_id}")
s.topic == apiSub.topic && s.number == apiSub.estate_id s.topic == apiSub.topic && s.number == apiSub.estate_id
} }
as SubscriptionEntity? as SubscriptionEntity?
...@@ -88,7 +86,6 @@ class SubscriptionRepository @Inject constructor( ...@@ -88,7 +86,6 @@ class SubscriptionRepository @Inject constructor(
db.deleteSubscriptions(it) db.deleteSubscriptions(it)
} }
Timber.w("to newSubList; ${newSubList}")
return db.upsert(newSubList) return db.upsert(newSubList)
.map {list -> list.map { .map {list -> list.map {
fromEntity( fromEntity(
......
...@@ -80,4 +80,7 @@ interface IDb { ...@@ -80,4 +80,7 @@ interface IDb {
fun deleteSubscriptions(entities: List<Subscription>) fun deleteSubscriptions(entities: List<Subscription>)
fun deleteEstate(entity: List<EstateEntity>) fun deleteEstate(entity: List<EstateEntity>)
fun deleteEstate(entity: EstateEntity) fun deleteEstate(entity: EstateEntity)
fun getUserDeals(uuid: Int): Observable<DealEntity?>
fun deleteDeal(entity: DealEntity)
fun deleteDeal(entity: List<DealEntity>)
} }
\ No newline at end of file
...@@ -196,6 +196,11 @@ class RequeryRepository @Inject constructor( ...@@ -196,6 +196,11 @@ class RequeryRepository @Inject constructor(
.and(EstateEntity.FAVORITE.eq(true)) .and(EstateEntity.FAVORITE.eq(true))
.get().observable() .get().observable()
override fun getUserDeals(uuid: Int): Observable<DealEntity?> =
store.select(DealEntity::class)
.where(DealEntity.USER_ID.eq(uuid))
.get().observable()
override fun setArticleReadState(id:Int,state:Boolean): Completable = override fun setArticleReadState(id:Int,state:Boolean): Completable =
store.update(ArticleEntity::class) store.update(ArticleEntity::class)
.set(ArticleEntity.READ,state) .set(ArticleEntity.READ,state)
...@@ -411,8 +416,12 @@ class RequeryRepository @Inject constructor( ...@@ -411,8 +416,12 @@ class RequeryRepository @Inject constructor(
override fun deleteEstate(entity:EstateEntity) = deleteBlocking(entity) override fun deleteEstate(entity:EstateEntity) = deleteBlocking(entity)
override fun deleteDeal(entity:DealEntity) = deleteBlocking(entity)
override fun deleteEstate(entity:List<EstateEntity>) = deleteBlocking(entity) override fun deleteEstate(entity:List<EstateEntity>) = deleteBlocking(entity)
override fun deleteDeal(entity:List<DealEntity>) = deleteBlocking(entity)
override fun deleteFile(entity:FileEntity) = deleteBlocking(entity) override fun deleteFile(entity:FileEntity) = deleteBlocking(entity)
override fun deleteFiles(entity:List<FileEntity>) = deleteBlocking(entity) override fun deleteFiles(entity:List<FileEntity>) = deleteBlocking(entity)
......
package com.biganto.visual.roompark.domain.contract package com.biganto.visual.roompark.domain.contract
import com.biganto.visual.roompark.data.repository.db.requrey.model.DealEntity
import com.biganto.visual.roompark.data.repository.db.requrey.model.EstateEntity import com.biganto.visual.roompark.data.repository.db.requrey.model.EstateEntity
import com.biganto.visual.roompark.data.repository.db.requrey.model.UserEntity import com.biganto.visual.roompark.data.repository.db.requrey.model.UserEntity
import com.biganto.visual.roompark.domain.model.DealModel
import com.biganto.visual.roompark.domain.model.EstateModel import com.biganto.visual.roompark.domain.model.EstateModel
import io.reactivex.Completable import io.reactivex.Completable
import io.reactivex.Observable import io.reactivex.Observable
...@@ -16,9 +16,9 @@ interface DealContract{ ...@@ -16,9 +16,9 @@ interface DealContract{
// fun getFavorites() : Observable<List<EstateModel>> // fun getFavorites() : Observable<List<EstateModel>>
fun getEstate(estateId: Int): Observable<EstateModel> fun getEstate(estateId: Int): Observable<EstateModel>
fun getDeals(): Observable<List<DealModel>>
fun fetchEstate(building: Int, number: Int): Observable<EstateModel> fun fetchEstate(building: Int, number: Int): Observable<EstateModel>
fun setDealRead(dealId: String): Completable fun setDealRead(dealId: String): Completable
fun fetchDeals(user: UserEntity): Observable<List<EstateEntity>> fun fetchDeals(user: UserEntity): Observable<List<DealEntity>>
fun fetchFavorites(user: UserEntity): Observable<List<EstateEntity>> fun fetchFavorites(user: UserEntity): Observable<List<EstateEntity>>
fun getDealsApi(user: UserEntity): Observable<List<DealEntity>>
} }
\ No newline at end of file
...@@ -20,8 +20,7 @@ class DealInteractor @Inject constructor( ...@@ -20,8 +20,7 @@ class DealInteractor @Inject constructor(
){ ){
fun getDeal(id:String): Observable<DealModel> = fun getDeal(id:String): Observable<DealModel> =
useCase.getDeals() useCase.prefetchDeal()
.doOnNext { Timber.d("$it") }
.map {deals -> deals.first { it.id==id } } .map {deals -> deals.first { it.id==id } }
fun getStatusList() = Observable.just(statusList.sortedBy{ it.orderId }) fun getStatusList() = Observable.just(statusList.sortedBy{ it.orderId })
......
package com.biganto.visual.roompark.domain.interactor package com.biganto.visual.roompark.domain.interactor
import com.biganto.visual.roompark.domain.model.DealModel
import com.biganto.visual.roompark.domain.model.StatusModel import com.biganto.visual.roompark.domain.model.StatusModel
import com.biganto.visual.roompark.domain.use_case.DealseUseCase import com.biganto.visual.roompark.domain.use_case.DealseUseCase
import io.reactivex.Observable import io.reactivex.Observable
...@@ -13,7 +14,9 @@ class DealsInteractor @Inject constructor( ...@@ -13,7 +14,9 @@ class DealsInteractor @Inject constructor(
val useCase:DealseUseCase val useCase:DealseUseCase
){ ){
fun fetchDeals() = useCase.getDeals() fun fetchDeals(): Observable<List<DealModel>> = useCase.prefetchDeal()
fun getDealsApi(): Observable<List<DealModel>> = useCase.getDeals()
// Single.just(arrayListOf(dealFlat, dealParkign)) // Single.just(arrayListOf(dealFlat, dealParkign))
fun getStatusList() = Observable.just(statusList.sortedBy{ it.orderId }) fun getStatusList() = Observable.just(statusList.sortedBy{ it.orderId })
......
package com.biganto.visual.roompark.domain.use_case package com.biganto.visual.roompark.domain.use_case
import com.biganto.visual.roompark.data.repository.db.requrey.model.DealEntity
import com.biganto.visual.roompark.domain.contract.AuthContract
import com.biganto.visual.roompark.domain.contract.DealContract import com.biganto.visual.roompark.domain.contract.DealContract
import com.biganto.visual.roompark.domain.model.DealModel
import com.biganto.visual.roompark.domain.model.fromEntity
import io.reactivex.Observable
import timber.log.Timber
import javax.inject.Inject import javax.inject.Inject
/** /**
...@@ -8,10 +14,23 @@ import javax.inject.Inject ...@@ -8,10 +14,23 @@ import javax.inject.Inject
*/ */
class DealseUseCase @Inject constructor( class DealseUseCase @Inject constructor(
private val contract: DealContract private val contract: DealContract,
private val authContract: AuthContract
) { ) {
fun getDeals() = contract.getDeals() fun prefetchDeal(): Observable<List<DealModel>> =
authContract.currentUser()
.map {user ->
user.deals?.asSequence()
?.map { it as DealEntity }
?.filterNotNull()?.toList()
}
.map { fromEntity(it, ::fromEntity) }
fun getDeals(): Observable<List<DealModel>> =
authContract.currentUser()
.flatMap(contract::getDealsApi)
.map { fromEntity(it, ::fromEntity) }
fun setDealRead(id:String) = contract.setDealRead(id) fun setDealRead(id:String) = contract.setDealRead(id)
......
...@@ -21,7 +21,10 @@ class PlanTypesUseCase @Inject constructor( ...@@ -21,7 +21,10 @@ class PlanTypesUseCase @Inject constructor(
) { ) {
private fun fetchUserEstates(user:UserEntity): Observable<List<EstateEntity>> = private fun fetchUserEstates(user:UserEntity): Observable<List<EstateEntity>> =
Observables.zip(dealContract.fetchDeals(user),dealContract.fetchFavorites(user)) Observables.zip(
dealContract.fetchDeals(user)
.map { it.map {deal -> deal.estate as EstateEntity } }
,dealContract.fetchFavorites(user))
{t1,t2 -> t1+t2} {t1,t2 -> t1+t2}
private val fetchAllPlanTypes = private val fetchAllPlanTypes =
......
...@@ -12,7 +12,7 @@ import com.biganto.visual.roompark.domain.model.SubscriptionTopic ...@@ -12,7 +12,7 @@ import com.biganto.visual.roompark.domain.model.SubscriptionTopic
import com.biganto.visual.roompark.domain.model.TitledSubscriptionModel import com.biganto.visual.roompark.domain.model.TitledSubscriptionModel
import com.biganto.visual.roompark.domain.model.fromEntity import com.biganto.visual.roompark.domain.model.fromEntity
import io.reactivex.Observable import io.reactivex.Observable
import io.reactivex.functions.BiFunction import io.reactivex.rxkotlin.Observables
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
import timber.log.Timber import timber.log.Timber
import javax.inject.Inject import javax.inject.Inject
...@@ -31,10 +31,9 @@ class SubscriptionUseCase @Inject constructor( ...@@ -31,10 +31,9 @@ class SubscriptionUseCase @Inject constructor(
fun subscribeTopic(subId: Int, topic: SubscriptionTopic): Observable<List<TitledSubscriptionModel>> = fun subscribeTopic(subId: Int, topic: SubscriptionTopic): Observable<List<TitledSubscriptionModel>> =
Observable.zip(auth.currentUser(), utils.getDeviceId() Observables.zip(auth.currentUser(), utils.getDeviceId()){
, BiFunction<UserEntity,String,SubscribeRequestModel> { user, token -> SubscribeRequestModel(user,token)
user, token -> SubscribeRequestModel(user,token) }
})
.flatMap {requestModel -> .flatMap {requestModel ->
subscription.subscribeTopicResult( subscription.subscribeTopicResult(
requestModel.user requestModel.user
...@@ -50,10 +49,9 @@ class SubscriptionUseCase @Inject constructor( ...@@ -50,10 +49,9 @@ class SubscriptionUseCase @Inject constructor(
fun unSubscribeTopic(subId: Int, topic: SubscriptionTopic): Observable<List<TitledSubscriptionModel>> = fun unSubscribeTopic(subId: Int, topic: SubscriptionTopic): Observable<List<TitledSubscriptionModel>> =
Observable.zip(auth.currentUser(), utils.getDeviceId() Observables.zip(auth.currentUser(), utils.getDeviceId()){
, BiFunction<UserEntity,String,SubscribeRequestModel> {
user, token -> SubscribeRequestModel(user,token) user, token -> SubscribeRequestModel(user,token)
}) }
.flatMap {requestModel -> .flatMap {requestModel ->
subscription.unSubscribeTopicResult( subscription.unSubscribeTopicResult(
requestModel.user requestModel.user
...@@ -102,7 +100,6 @@ class SubscriptionUseCase @Inject constructor( ...@@ -102,7 +100,6 @@ class SubscriptionUseCase @Inject constructor(
.map {user -> .map {user ->
var sub = user.subscriptions var sub = user.subscriptions
?.firstOrNull { it.topic == topic.topicName && it.number == topic.topicId } ?.firstOrNull { it.topic == topic.topicName && it.number == topic.topicId }
Timber.d("fetched topic: $sub")
if (sub == null) { if (sub == null) {
sub = SubscriptionEntity() sub = SubscriptionEntity()
sub.setOwner(user) sub.setOwner(user)
...@@ -110,9 +107,7 @@ class SubscriptionUseCase @Inject constructor( ...@@ -110,9 +107,7 @@ class SubscriptionUseCase @Inject constructor(
sub.setNumber(topic.topicId) sub.setNumber(topic.topicId)
sub.setState(false) sub.setState(false)
} }
Timber.w("sub is : $sub")
subscription.saveSubscribeState(sub as SubscriptionEntity) subscription.saveSubscribeState(sub as SubscriptionEntity)
.doOnNext { Timber.d("zzz blocking $it") }
.blockingFirst() .blockingFirst()
} }
.map(::fromEntity) .map(::fromEntity)
......
...@@ -38,28 +38,29 @@ class DealScreenPresenter @Inject constructor( ...@@ -38,28 +38,29 @@ class DealScreenPresenter @Inject constructor(
restoreStateObservable.accept(DealScreenViewState.RestoreView(restoreModel)) restoreStateObservable.accept(DealScreenViewState.RestoreView(restoreModel))
} }
private val fetchDeal = interactor.getDeal(dealId)
.doOnNext { restoreModel.deal = it }
.map<DealScreenViewState>{ deal ->
DealScreenViewState.LoadDeal(deal ,interactor.getStatusListSync())
}
override fun bindIntents() { override fun bindIntents() {
val fetchDeal = interactor.getDeal(dealId)
.doOnNext { restoreModel.deal = it }
.map<DealScreenViewState>{ deal ->
DealScreenViewState.LoadDeal(deal ,interactor.getStatusListSync())
}.share()
val setRead = interactor.setDealRead(dealId) val setRead = interactor.setDealRead(dealId)
.andThen(Observable.just(DealScreenViewState.Idle())) .andThen(Observable.just(DealScreenViewState.Idle()))
val onSubChecked = intent(DealScreen::onSubscription) val onSubChecked = intent(DealScreen::onSubscription)
.filter { restoreModel.sub != null } .filter { restoreModel.sub != null }
.flatMap { newState -> .flatMap { newState ->
interactor.switchSubscription(restoreModel.sub!!, newState) interactor.switchSubscription(restoreModel.sub!!, newState)
.map {subs -> .map {subs ->
Timber.d("Got subs: $subs")
val s = subs.map { it.subModel }.firstOrNull {it.id == restoreModel.sub?.id} val s = subs.map { it.subModel }.firstOrNull {it.id == restoreModel.sub?.id}
restoreModel.sub = s restoreModel.sub = s
Timber.d("Got s: $s")
if (s!=null) if (s!=null)
return@map DealScreenViewState.SubscriptionStatus(s.state) return@map DealScreenViewState.SubscriptionStatus(s.state)
else else
...@@ -74,17 +75,19 @@ class DealScreenPresenter @Inject constructor( ...@@ -74,17 +75,19 @@ class DealScreenPresenter @Inject constructor(
interactor.getSubscriptions( interactor.getSubscriptions(
(fetchedDealViewState as DealScreenViewState.LoadDeal).estate.estate_id (fetchedDealViewState as DealScreenViewState.LoadDeal).estate.estate_id
) )
.doAfterNext { restoreModel.sub = it } .doOnNext { 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()))
}
}
.onErrorReturn (::parseError)
val onStartTours = intent(DealScreen::tourCardClicked) val onStartTours = intent(DealScreen::tourCardClicked)
.map { restoreModel.deal } .map { restoreModel.deal }
.map{ it.estate } .map{ it.estate }
.flatMap {estate -> toursInteractor.getEstateTourList(estate) .flatMap {estate -> toursInteractor.getEstateTourList(estate)
.map { DealScreenViewState.ToursLoaded(it) } .map<DealScreenViewState> { DealScreenViewState.ToursLoaded(it) }
.onErrorReturn (::parseError)
} }
......
...@@ -53,6 +53,22 @@ class DealsScreenPresenter @Inject constructor( ...@@ -53,6 +53,22 @@ class DealsScreenPresenter @Inject constructor(
.onErrorReturn(::parseError) .onErrorReturn(::parseError)
val getDeals = interactor.getDealsApi()
.flatMap { deals ->
getStatusList
.map{
List(deals.size) { index ->
DealPreviewModel(
Pair(deals[index], it)
)
}
}
}
.doOnNext { restoreModel.list = it.toMutableList() }
.map<DealsScreenViewState>(DealsScreenViewState::DealsLoaded)
.onErrorReturn(::parseError)
val onStartTours = intent(DealsScreen::tourCardClicked) val onStartTours = intent(DealsScreen::tourCardClicked)
.flatMap {dealPreview -> .flatMap {dealPreview ->
toursInteractor.getEstateTourList(dealPreview.tourId,dealPreview.estateId) toursInteractor.getEstateTourList(dealPreview.tourId,dealPreview.estateId)
...@@ -63,6 +79,7 @@ class DealsScreenPresenter @Inject constructor( ...@@ -63,6 +79,7 @@ class DealsScreenPresenter @Inject constructor(
arrayListOf( arrayListOf(
restoreStateObservable, restoreStateObservable,
fetchDeals, fetchDeals,
getDeals,
onStartTours onStartTours
) )
) )
......
...@@ -37,6 +37,7 @@ class EstateScreenPresenter @Inject constructor( ...@@ -37,6 +37,7 @@ class EstateScreenPresenter @Inject constructor(
private fun getPlan(plan: PlanPresetModel): Observable<EstateScreenViewState> = private fun getPlan(plan: PlanPresetModel): Observable<EstateScreenViewState> =
interactor.getPlan(plan) interactor.getPlan(plan)
.map<EstateScreenViewState> { EstateScreenViewState.LoadPlan(it) } .map<EstateScreenViewState> { EstateScreenViewState.LoadPlan(it) }
.onErrorReturn (::parseError)
private var restoreModel = RestoreModel(null,null) private var restoreModel = RestoreModel(null,null)
...@@ -50,11 +51,13 @@ class EstateScreenPresenter @Inject constructor( ...@@ -50,11 +51,13 @@ class EstateScreenPresenter @Inject constructor(
val prefetchCards = interactor.getEstate(estateId) val prefetchCards = interactor.getEstate(estateId)
.doOnNext { restoreModel.estate = it.copy() } .doOnNext { restoreModel.estate = it.copy() }
.map { EstateScreenViewState.LoadEstate(it) } .map<EstateScreenViewState> { EstateScreenViewState.LoadEstate(it) }
.onErrorReturn (::parseError)
val fetchPlans = interactor.getPlanTypes(estateId) val fetchPlans = interactor.getPlanTypes(estateId)
.doOnNext {restoreModel.planList = it.toList() } .doOnNext {restoreModel.planList = it.toList() }
.map { EstateScreenViewState.LoadPlanTypes(it) } .map<EstateScreenViewState> { EstateScreenViewState.LoadPlanTypes(it) }
.onErrorReturn (::parseError)
val fetchPlan = intent(EstateScreen::planTypesTabSelected) val fetchPlan = intent(EstateScreen::planTypesTabSelected)
.map { restoreModel.planList?.get(it) } .map { restoreModel.planList?.get(it) }
...@@ -77,6 +80,7 @@ class EstateScreenPresenter @Inject constructor( ...@@ -77,6 +80,7 @@ class EstateScreenPresenter @Inject constructor(
) )
) )
) )
.onErrorReturn (::parseError)
} }
val switchSizes = intent(EstateScreen::switchSizes) val switchSizes = intent(EstateScreen::switchSizes)
......
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