Skip to content

Commit

Permalink
Don't hide dialogs on leaving screen (#1205)
Browse files Browse the repository at this point in the history
  • Loading branch information
igordanilcenko committed Sep 16, 2024
1 parent a3abb7b commit 23f2e60
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ abstract class CommonActivity<Binding : ViewBinding, VM : CommonViewModel> : App

override fun onStop() {
shakeDetector.stop()
dialogManager.dismiss() // TODO don't dismiss dialogs onStop. Think about a better way to handle this.
super.onStop()
screenCaptureCallback?.let { unregisterScreenCaptureCallback(it) }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,6 @@ abstract class CommonFragment<Binding : ViewBinding, VM : CommonViewModel> : Fra
action()
}
}

override fun onDestroy() {
dialogManager?.dismiss()
super.onDestroy()
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import com.tari.android.wallet.di.ApplicationComponent
import com.tari.android.wallet.di.DiContainer
import com.tari.android.wallet.event.EventBus
import com.tari.android.wallet.extension.addTo
import com.tari.android.wallet.extension.launchOnMain
import com.tari.android.wallet.ffi.FFIWallet
import com.tari.android.wallet.infrastructure.logging.LoggerTags
import com.tari.android.wallet.model.CoreError
Expand All @@ -42,7 +43,6 @@ import com.tari.android.wallet.ui.fragment.home.navigation.TariNavigator
import com.tari.android.wallet.ui.fragment.settings.themeSelector.TariTheme
import io.reactivex.disposables.CompositeDisposable
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
import javax.inject.Inject
Expand Down Expand Up @@ -271,7 +271,7 @@ open class CommonViewModel : ViewModel() {
}

fun hideDialog(dialogId: Int = ModularDialogArgs.DialogId.NO_ID) {
viewModelScope.launch(Dispatchers.Main) {
launchOnMain {
dialogManager.dismiss(dialogId)
}
}
Expand Down

0 comments on commit 23f2e60

Please sign in to comment.