mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 02:15:35 +03:00
Remove usage of GlobalScope
This commit is contained in:
parent
25b4c32fd0
commit
1e708b113b
2 changed files with 3 additions and 4 deletions
|
@ -52,7 +52,6 @@ import im.vector.app.features.MainActivityArgs
|
|||
import im.vector.app.features.workers.signout.SignOutUiWorker
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.matrix.android.sdk.api.failure.isInvalidPassword
|
||||
|
@ -224,7 +223,7 @@ class VectorSettingsGeneralFragment @Inject constructor(
|
|||
it.summary = TextUtils.formatFileSize(requireContext(), size.toLong())
|
||||
|
||||
it.onPreferenceClickListener = Preference.OnPreferenceClickListener {
|
||||
GlobalScope.launch(Dispatchers.Main) {
|
||||
lifecycleScope.launch(Dispatchers.Main) {
|
||||
// On UI Thread
|
||||
displayLoadingView()
|
||||
|
||||
|
|
|
@ -36,11 +36,11 @@ import im.vector.app.features.powerlevel.PowerLevelsObservableFactory
|
|||
import im.vector.app.features.rageshake.BugReporter
|
||||
import im.vector.app.features.rageshake.ReportType
|
||||
import im.vector.app.features.roomprofile.RoomProfileActivity
|
||||
import im.vector.app.features.session.coroutineScope
|
||||
import im.vector.app.features.settings.VectorPreferences
|
||||
import im.vector.app.features.spaces.manage.ManageType
|
||||
import im.vector.app.features.spaces.manage.SpaceManageActivity
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.parcelize.Parcelize
|
||||
import org.matrix.android.sdk.api.session.events.model.EventType
|
||||
|
@ -140,7 +140,7 @@ class SpaceSettingsMenuBottomSheet : VectorBaseBottomSheetDialogFragment<BottomS
|
|||
AlertDialog.Builder(requireContext())
|
||||
.setMessage(getString(R.string.space_leave_prompt_msg))
|
||||
.setPositiveButton(R.string.leave) { _, _ ->
|
||||
GlobalScope.launch {
|
||||
session.coroutineScope.launch {
|
||||
try {
|
||||
session.getRoom(spaceArgs.spaceId)?.leave(null)
|
||||
} catch (failure: Throwable) {
|
||||
|
|
Loading…
Reference in a new issue