Commit 817a65ce authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

fix flat sold message

parent 56ddc3d9
......@@ -126,6 +126,7 @@ class FindFlatScreenController :
is FindFlatScreenViewState.SomeError -> render(viewState)
is FindFlatScreenViewState.FlatFounded -> render(viewState)
is FindFlatScreenViewState.FlatNotFound -> render(viewState)
is FindFlatScreenViewState.FlatSold -> render(viewState)
is FindFlatScreenViewState.StartFlat -> render(viewState)
is FindFlatScreenViewState.RestoreView -> render(viewState)
}
......@@ -156,8 +157,14 @@ class FindFlatScreenController :
{findFlatButton.text = resources?.getString(it)},
{findFlatButton.text = it}
)
}
private fun render(viewState: FindFlatScreenViewState.FlatSold){
findFlatButton.isEnabled = false
viewState.exceptionString.selectHandler(
{findFlatButton.text = resources?.getString(it)},
{findFlatButton.text = it}
)
}
private fun render(viewState: FindFlatScreenViewState.StartFlat){
......
......@@ -37,6 +37,7 @@ class FindFlatScreenPresenter @Inject constructor(
override fun vsByCode(code: Int): (ExceptionString) -> FindFlatScreenViewState =
when (code) {
304 -> {message:ExceptionString ->FindFlatScreenViewState.FlatNotFound(message)}
307 -> {message:ExceptionString ->FindFlatScreenViewState.FlatSold(message)}
else -> super.vsByCode(code)
}
......
......@@ -13,6 +13,7 @@ sealed class FindFlatScreenViewState : BigantoBaseViewState() {
class RequstFlatProgress : FindFlatScreenViewState()
class FlatFounded : FindFlatScreenViewState()
class FlatNotFound(val exceptionString:ExceptionString) : FindFlatScreenViewState()
class FlatSold(val exceptionString:ExceptionString) : FindFlatScreenViewState()
class StartFlat(val esateId:Int) : FindFlatScreenViewState()
class SomeError(val exception: ExceptionString) : FindFlatScreenViewState()
class RestoreView(val restore:RestoreModel) : FindFlatScreenViewState()
......
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