Skip to content

Commit

Permalink
Merge pull request #127 from AnonymusRaccoon/mobile_client_timeout
Browse files Browse the repository at this point in the history
Mobile client timeout
  • Loading branch information
Octopus773 authored Mar 6, 2022
2 parents 8630d15 + 4b108d5 commit d4cc91a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions mobile/lib/src/aeris_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,11 @@ class AerisAPI {
}

Future<bool> createConnectionFromService(Service service, String code) async {
final serviceName = service == const Service.youtube()
? "google"
: service.name.toLowerCase();
http.Response response = await _requestAPI(
'/auth/${service.name.toLowerCase()}/signin?code=$code',
'/auth/$serviceName/signin?code=$code',
AerisAPIRequestType.post, {});
if (!response.ok) {
return false;
Expand Down Expand Up @@ -220,7 +223,7 @@ class AerisAPI {
if (_connected) {
header.addAll({'Authorization': 'Bearer $_jwt'});
}
const duration = Duration(seconds: 3);
const duration = Duration(seconds: 10);
try {
switch (requestType) {
case AerisAPIRequestType.delete:
Expand Down
2 changes: 1 addition & 1 deletion mobile/lib/src/views/login_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class LoginPage extends StatelessWidget {
label: service.name,
callback: () async {
await launch(Uri.parse(service.authSignInUrl).toString(), forceSafariVC: false);
return Future.delayed(Duration(seconds: 3)).then((value) {
return Future.delayed(Duration(seconds: 8)).then((value) {
return GetIt.I<AerisAPI>().isConnected ? null : AppLocalizations.of(context).cantSignInFromService;
});
}
Expand Down

0 comments on commit d4cc91a

Please sign in to comment.