Skip to content

Commit

Permalink
Prevent double authentication prompt when enabling app lock
Browse files Browse the repository at this point in the history
  • Loading branch information
RoboMagus committed Oct 10, 2022
1 parent ac88379 commit 58dc1c4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,9 @@ class SettingsFragment constructor(
val switchLock = findPreference<SwitchPreference>("app_lock")
switchLock?.isChecked = success

// Prevent requesting authentication after just enabling the app lock
presenter.setAppActive(success)

findPreference<SwitchPreference>("app_lock_home_bypass")?.isVisible = success
findPreference<EditTextPreference>("session_timeout")?.isVisible = success
return (result == Authenticator.SUCCESS || result == Authenticator.CANCELED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ interface SettingsPresenter {
fun onCreate()
fun onFinish()
fun updateInternalUrlStatus()
fun isLockEnabled(): Boolean
fun sessionTimeOut(): Int
fun setAppActive(active: Boolean)
suspend fun getNotificationRateLimits(): RateLimitResponse?

fun isSsidUsed(): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,9 @@ class SettingsPresenterImpl @Inject constructor(
settingsView.updateSsids(ssids)
}

override fun isLockEnabled(): Boolean {
return runBlocking {
authenticationUseCase.isLockEnabled()
}
}

override fun sessionTimeOut(): Int {
return runBlocking {
integrationUseCase.getSessionTimeOut()
override fun setAppActive(active: Boolean) {
runBlocking {
integrationUseCase.setAppActive(active)
}
}

Expand Down

0 comments on commit 58dc1c4

Please sign in to comment.