mirror of
https://github.com/zoriya/Aeris.git
synced 2026-06-02 02:46:15 +00:00
Mobile Client: fix race condition
This commit is contained in:
@@ -68,6 +68,8 @@ class AerisAPI {
|
||||
http.Response response = await _requestAPI(
|
||||
'/auth/${service.name.toLowerCase()}/signin?code=$code',
|
||||
AerisAPIRequestType.post, {});
|
||||
print(response.body);
|
||||
print(response.statusCode);
|
||||
if (!response.ok) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:aeris/src/aeris_api.dart';
|
||||
import 'package:aeris/main.dart';
|
||||
import 'package:aeris/src/models/service.dart';
|
||||
@@ -73,7 +75,9 @@ class LoginPage extends StatelessWidget {
|
||||
label: service.name,
|
||||
callback: () async {
|
||||
await launch(Uri.parse(service.authSignInUrl).toString(), forceSafariVC: false);
|
||||
return GetIt.I<AerisAPI>().isConnected ? null : AppLocalizations.of(context).cantSignInFromService;
|
||||
return Future.delayed(Duration(seconds: 3)).then((value) {
|
||||
return GetIt.I<AerisAPI>().isConnected ? null : AppLocalizations.of(context).cantSignInFromService;
|
||||
});
|
||||
}
|
||||
)
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user