mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-02-02 14:16:58 +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 ServerDomain serverDomain,
|
||||||
final ServerHostingDetails? serverDetails,
|
final ServerHostingDetails? serverDetails,
|
||||||
) {
|
) {
|
||||||
if (serverDetails != null) {
|
if (serverDetails == null) {
|
||||||
if (serverProviderToken != null) {
|
return RecoveryStep.selecting;
|
||||||
if (serverDetails.provider != ServerProviderType.unknown) {
|
}
|
||||||
if (serverDomain.provider != DnsProviderType.unknown) {
|
|
||||||
return RecoveryStep.backblazeToken;
|
if (serverProviderToken == null) {
|
||||||
}
|
|
||||||
return RecoveryStep.dnsProviderToken;
|
|
||||||
}
|
|
||||||
return RecoveryStep.serverSelection;
|
|
||||||
}
|
|
||||||
return RecoveryStep.serverProviderToken;
|
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() {
|
void clearAppConfig() {
|
||||||
|
|
Loading…
Reference in a new issue