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

Commit a82ec1b8 authored by Sayantan Roychowdhury's avatar Sayantan Roychowdhury
Browse files

issue_5413_2: TimeoutFragment - remove isNoAuthRefreshExecuted flag

parent 2a3ec884
Loading
Loading
Loading
Loading
+1 −11
Original line number Diff line number Diff line
@@ -82,7 +82,6 @@ abstract class TimeoutFragment(@LayoutRes layoutId: Int) : Fragment(layoutId) {
     * If returns false, then after running the function, we attempt to refresh GPlay token.
     */
    open fun noAuthRefresh(): Boolean = false
    private var isNoAuthRefreshExecuted = false

    /*
     * Checks if network connectivity is present.
@@ -100,16 +99,7 @@ abstract class TimeoutFragment(@LayoutRes layoutId: Int) : Fragment(layoutId) {
                dismissTimeoutDialog()
                refreshData(authData)
            } else {
                /*
                 * Run noAuthRefresh() only once.
                 * Once it has been run, set isNoAuthRefreshExecuted to true.
                 */
                val noAuthRefreshResult = if (isNoAuthRefreshExecuted) {
                    false
                } else {
                    isNoAuthRefreshExecuted = true
                    noAuthRefresh()
                }
                val noAuthRefreshResult = noAuthRefresh()

                if (!noAuthRefreshResult &&
                    mainActivityViewModel.authValidity.value != null