Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 020237ab authored by Sayantan Roychowdhury's avatar Sayantan Roychowdhury
Browse files

Merge branch '1201-check_connection_before_dialog_display' into 'main'

Issue 1201: Show error dialogs only if internet connection is present

See merge request !317
parents ac332cd1 0c5f5358
Loading
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -215,10 +215,11 @@ abstract class TimeoutFragment(@LayoutRes layoutId: Int) : Fragment(layoutId) {
     * Show a dialog, dismiss previously shown dialog in [lastDialog].
     */
    private fun showAndSetDialog(alertDialogBuilder: AlertDialog.Builder) {
        alertDialogBuilder.create().run {
        if (lastDialog?.isShowing == true) {
            lastDialog?.dismiss()
        }
        if (mainActivityViewModel.internetConnection.value != true) return
        alertDialogBuilder.create().run {
            this.show()
            lastDialog = this
        }