Skip to content

Commit

Permalink
Merge pull request #1309 from minvws/refresh_credentials_on_resume
Browse files Browse the repository at this point in the history
Always refresh credentials on resume
  • Loading branch information
BartNijland91 authored Jun 13, 2022
2 parents 0d50703 + 9e1e604 commit d76e854
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ class DashboardViewModelImpl(
private suspend fun refreshCredentials(dashboardSync: DashboardSync) {
mutex.withLock {
val previousSyncResult = databaseSyncerResultLiveData.value?.peekContent()
val hasDoneRefreshCall = previousSyncResult != null

// Check if we need to load new credentials
val shouldLoadNewCredentials = when (dashboardSync) {
Expand All @@ -89,8 +88,7 @@ class DashboardViewModelImpl(
}
is DashboardSync.CheckSync -> {
// Load new credentials if no previous refresh has been executed and we should refresh because a credentials for a green card expired
val shouldRefreshCredentials =
(greenCardRefreshUtil.shouldRefresh() && !hasDoneRefreshCall)
val shouldRefreshCredentials = greenCardRefreshUtil.shouldRefresh()

// Load new credentials if we the previous request failed more than once and more than x minutes ago
val shouldRetryFailedRequest =
Expand Down

0 comments on commit d76e854

Please sign in to comment.