From 29b0bf23976111fad52fbc77930305b1936206cc Mon Sep 17 00:00:00 2001 From: NaiJi Date: Wed, 30 Nov 2022 19:05:21 +0400 Subject: [PATCH] fix: Fix some initializing errors Correct progress index calculation and hardcore cloudflare loading until new providers for DNS are supported --- .../server_installation_repository.dart | 13 ++++++------- .../server_installation_state.dart | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/logic/cubit/server_installation/server_installation_repository.dart b/lib/logic/cubit/server_installation/server_installation_repository.dart index fb4d9d15..80c3ee0d 100644 --- a/lib/logic/cubit/server_installation/server_installation_repository.dart +++ b/lib/logic/cubit/server_installation/server_installation_repository.dart @@ -75,13 +75,12 @@ class ServerInstallationRepository { ); } - if (serverDomain != null && serverDomain.provider != DnsProvider.unknown) { - ApiController.initDnsProviderApiFactory( - DnsProviderApiFactorySettings( - provider: serverDomain.provider, - ), - ); - } + // No other DNS provider is supported for now, so it's fine. + ApiController.initDnsProviderApiFactory( + DnsProviderApiFactorySettings( + provider: DnsProvider.cloudflare, + ), + ); if (box.get(BNames.hasFinalChecked, defaultValue: false)) { return ServerInstallationFinished( diff --git a/lib/logic/cubit/server_installation/server_installation_state.dart b/lib/logic/cubit/server_installation/server_installation_state.dart index 331c3e2a..69934bbd 100644 --- a/lib/logic/cubit/server_installation/server_installation_state.dart +++ b/lib/logic/cubit/server_installation/server_installation_state.dart @@ -48,7 +48,7 @@ abstract class ServerInstallationState extends Equatable { bool get isFullyInitilized => _fulfilementList.every((final el) => el!); ServerSetupProgress get progress => ServerSetupProgress - .values[_fulfilementList.where((final el) => el!).length]; + .values[_fulfilementList.where((final el) => el!).length + 1]; int get porgressBar { if (progress.index < 6) {