diff --git a/lib/providers/auth.dart b/lib/providers/auth.dart index e817e5ce..9cc31c78 100644 --- a/lib/providers/auth.dart +++ b/lib/providers/auth.dart @@ -88,17 +88,17 @@ class AuthProvider with ChangeNotifier { serverVersion = json.decode(response.body); } - Future initData(String serverUrl) async { - this.serverUrl = serverUrl; - await setApplicationVersion(); - await setServerVersion(); - } - /// (flutter) Application version Future setApplicationVersion() async { applicationVersion = await PackageInfo.fromPlatform(); } + Future initVersions(String serverUrl) async { + this.serverUrl = serverUrl; + await setApplicationVersion(); + await setServerVersion(); + } + /// Checking if there is a new version of the application. Future applicationUpdateRequired([ String? version, @@ -149,11 +149,6 @@ class AuthProvider with ChangeNotifier { throw WgerHttpException(response.body); } - // If update is required don't log in user - if (await applicationUpdateRequired()) { - return {'action': LoginActions.update}; - } - return login(username, password, serverUrl); } @@ -179,7 +174,7 @@ class AuthProvider with ChangeNotifier { throw WgerHttpException(response.body); } - await initData(serverUrl); + await initVersions(serverUrl); // If update is required don't log in user if (await applicationUpdateRequired()) {