fix: Improve API URL handling and force init after setting a new config

This commit is contained in:
Alberto Ponces 2022-09-19 00:28:26 +01:00
parent c333fa3c33
commit 6c2ceed91f
4 changed files with 26 additions and 56 deletions

View file

@ -15,9 +15,10 @@ Future main() async {
await setupLocator();
WidgetsFlutterBinding.ensureInitialized();
await locator<ManagerAPI>().initialize();
await locator<PatcherAPI>().initialize();
locator<RevancedAPI>().initialize();
String apiUrl = locator<ManagerAPI>().getApiUrl();
await locator<RevancedAPI>().initialize(apiUrl);
locator<GithubAPI>().initialize();
await locator<PatcherAPI>().initialize();
runApp(const MyApp());
}