fix: bound provider storage retries
This commit is contained in:
@@ -32,9 +32,11 @@ class LoginViewModel @Inject constructor(
|
||||
private var usernameEdited = false
|
||||
private var rememberUsernameEdited = false
|
||||
private var autoLoginEdited = false
|
||||
private var loadedProfileId: com.flagship.abox.manager.domain.ProviderProfileId? = null
|
||||
|
||||
fun loadProfile(value: ProviderProfile) {
|
||||
if (profile?.id == value.id &&
|
||||
if (loadedProfileId == value.id ||
|
||||
profile?.id == value.id &&
|
||||
(loadingJob?.isActive == true || submitJob?.isActive == true)
|
||||
) return
|
||||
loadingJob?.cancel()
|
||||
@@ -65,6 +67,7 @@ class LoginViewModel @Inject constructor(
|
||||
},
|
||||
isLoadingPreferences = false,
|
||||
)
|
||||
loadedProfileId = value.id
|
||||
} catch (error: CancellationException) {
|
||||
throw error
|
||||
} catch (_: Exception) {
|
||||
@@ -92,6 +95,7 @@ class LoginViewModel @Inject constructor(
|
||||
return
|
||||
}
|
||||
profile = null
|
||||
loadedProfileId = null
|
||||
usernameEdited = false
|
||||
rememberUsernameEdited = false
|
||||
autoLoginEdited = false
|
||||
|
||||
Reference in New Issue
Block a user