mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-11-19 07:09:14 +00:00
fix(recovery): Fix installation recovery current step resolving
- Refactor the nested if-pyramid - Replace the DnsProviderType check with a simple check for a token string, since we receive DnsProviderType from the server and the user has no actions in it - Make sure the server selection prompt isn't skipped before asking for a DNS token - Resolve: #395
This commit is contained in:
parent
50bc9d8965
commit
f938a04c5e
|
@ -156,19 +156,22 @@ class ServerInstallationRepository {
|
|||
final ServerDomain serverDomain,
|
||||
final ServerHostingDetails? serverDetails,
|
||||
) {
|
||||
if (serverDetails != null) {
|
||||
if (serverProviderToken != null) {
|
||||
if (serverDetails.provider != ServerProviderType.unknown) {
|
||||
if (serverDomain.provider != DnsProviderType.unknown) {
|
||||
return RecoveryStep.backblazeToken;
|
||||
}
|
||||
return RecoveryStep.dnsProviderToken;
|
||||
}
|
||||
return RecoveryStep.serverSelection;
|
||||
}
|
||||
if (serverDetails == null) {
|
||||
return RecoveryStep.selecting;
|
||||
}
|
||||
|
||||
if (serverProviderToken == null) {
|
||||
return RecoveryStep.serverProviderToken;
|
||||
}
|
||||
return RecoveryStep.selecting;
|
||||
|
||||
/// We don't write anything to the database after .serverSelection
|
||||
/// step, therefore we have to re-ask it again before prompting for
|
||||
/// DNS token, if it wasn't provided yet.
|
||||
if (dnsProviderToken == null) {
|
||||
return RecoveryStep.serverSelection;
|
||||
}
|
||||
|
||||
return RecoveryStep.backblazeToken;
|
||||
}
|
||||
|
||||
void clearAppConfig() {
|
||||
|
|
Loading…
Reference in a new issue