Commit 9f83fed0 authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

fix check to filter for complex stability

parent 1decd3ad
...@@ -124,12 +124,11 @@ class StartPlansDownloadingDialogController : Controller { ...@@ -124,12 +124,11 @@ class StartPlansDownloadingDialogController : Controller {
view.findViewById<Button>(R.id.alert_ok_button) view.findViewById<Button>(R.id.alert_ok_button)
.clicks() .clicks()
.map { .filter{
if (!networkMonitor.isConnected){ if (!networkMonitor.isConnected){
snackbar.showSnackBar(R.string.no_network_error) snackbar.showSnackBar(R.string.no_network_error)
return@map null
} }
else return@map it networkMonitor.isConnected
} }
.debounce(200, TimeUnit.MILLISECONDS) .debounce(200, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
......
...@@ -14,6 +14,7 @@ import com.biganto.visual.roompark.base.RoomParkApplication ...@@ -14,6 +14,7 @@ import com.biganto.visual.roompark.base.RoomParkApplication
import com.biganto.visual.roompark.base.RoomParkMainActivity import com.biganto.visual.roompark.base.RoomParkMainActivity
import com.biganto.visual.roompark.data.repository.file.FileModule import com.biganto.visual.roompark.data.repository.file.FileModule
import com.biganto.visual.roompark.data.service.network.INetworkMonitor import com.biganto.visual.roompark.data.service.network.INetworkMonitor
import com.biganto.visual.roompark.data.service.network.NoNetworkException
import com.biganto.visual.roompark.di.dagger.ActivityModule import com.biganto.visual.roompark.di.dagger.ActivityModule
import com.biganto.visual.roompark.di.dagger.AppComponent import com.biganto.visual.roompark.di.dagger.AppComponent
import com.biganto.visual.roompark.di.dagger.PerScreen import com.biganto.visual.roompark.di.dagger.PerScreen
...@@ -116,12 +117,11 @@ class StartToursDownloadingDialogController : Controller { ...@@ -116,12 +117,11 @@ class StartToursDownloadingDialogController : Controller {
detachDisposable.add( detachDisposable.add(
view.findViewById<Button>(R.id.alert_ok_button) view.findViewById<Button>(R.id.alert_ok_button)
.clicks() .clicks()
.map { .filter{
if (!networkMonitor.isConnected){ if (!networkMonitor.isConnected){
snackbar.showSnackBar(R.string.no_network_error) snackbar.showSnackBar(R.string.no_network_error)
return@map null
} }
else return@map it networkMonitor.isConnected
} }
.debounce(200, TimeUnit.MILLISECONDS) .debounce(200, TimeUnit.MILLISECONDS)
.observeOn(Schedulers.io()) .observeOn(Schedulers.io())
......
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