diff --git a/lib/config/get_it_config.dart b/lib/config/get_it_config.dart index aa3db90b..5f6d55cb 100644 --- a/lib/config/get_it_config.dart +++ b/lib/config/get_it_config.dart @@ -13,9 +13,11 @@ final GetIt getIt = GetIt.instance; Future getItSetup() async { getIt.registerSingleton(NavigationService()); - getIt.registerSingleton(ConsoleModel()); - getIt.registerSingleton(ApiConfigModel()..init()); + + final apiConfigModel = ApiConfigModel(); + await apiConfigModel.init(); + getIt.registerSingleton(apiConfigModel); getIt.registerSingleton( ApiConnectionRepository()..init(), diff --git a/lib/logic/cubit/server_installation/server_installation_repository.dart b/lib/logic/cubit/server_installation/server_installation_repository.dart index 75daa0ab..b15cebae 100644 --- a/lib/logic/cubit/server_installation/server_installation_repository.dart +++ b/lib/logic/cubit/server_installation/server_installation_repository.dart @@ -501,7 +501,7 @@ class ServerInstallationRepository { Future deleteServerProviderKey() async { await box.delete(BNames.hetznerKey); - getIt().init(); + await getIt().init(); } Future saveBackblazeKey( @@ -512,7 +512,7 @@ class ServerInstallationRepository { Future deleteBackblazeKey() async { await box.delete(BNames.backblazeCredential); - getIt().init(); + await getIt().init(); } Future setDnsApiToken(final String key) async { @@ -521,7 +521,7 @@ class ServerInstallationRepository { Future deleteDnsProviderKey() async { await box.delete(BNames.cloudFlareKey); - getIt().init(); + await getIt().init(); } Future saveDomain(final ServerDomain serverDomain) async {