Skip to content

Commit

Permalink
Change CoroutineScope Dispatcher to IO (#370)
Browse files Browse the repository at this point in the history
* Change CoroutineScope Dispatcher to IO
this lets the getLastKnownLocation() method launches

* Change CoroutineScope Dispatcher to Main + SupervisorJob()
this lets the getLastKnownLocation() method launches

* Removed wildcard and added individual imports

* Removed unneeded import

---------

Co-authored-by: Muhammad <[email protected]>
Co-authored-by: Ferran Pons <[email protected]>
  • Loading branch information
3 people authored Mar 1, 2023
1 parent 53a16b8 commit 9f337e4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.adevinta.leku.geocoder.timezone.GoogleTimeZoneDataSource
import com.adevinta.leku.utils.ReactiveLocationProvider
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.cancel
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
Expand All @@ -22,7 +23,7 @@ class GeocoderPresenter @JvmOverloads constructor(
private val googleTimeZoneDataSource: GoogleTimeZoneDataSource? = null
) {

private val coroutineScope = CoroutineScope(Dispatchers.Main)
private val coroutineScope = CoroutineScope(Dispatchers.Main + SupervisorJob())
private var view: GeocoderViewInterface? = null
private val nullView = GeocoderViewInterface.NullView()
private var isGooglePlacesEnabled = false
Expand Down

0 comments on commit 9f337e4

Please sign in to comment.