Skip to content

Commit

Permalink
fixup! TF-2965 Add retry capability for OIDC check request
Browse files Browse the repository at this point in the history
  • Loading branch information
tddang-linagora committed Sep 16, 2024
1 parent f5c740b commit 4bdeb9c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/features/login/presentation/base_login_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ abstract class BaseLoginView extends GetWidget<LoginController> {
),
onPressed: onRetry,
child: Text(
AppLocalizations.of(context).retry,
AppLocalizations.of(context).tryAgain,
style: const TextStyle(fontSize: 16, color: Colors.white)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import 'package:tmail_ui_user/features/login/domain/state/dns_lookup_to_get_jmap
import 'package:tmail_ui_user/features/login/domain/state/get_oidc_configuration_state.dart';
import 'package:tmail_ui_user/features/login/domain/state/get_token_oidc_state.dart';
import 'package:tmail_ui_user/features/login/presentation/login_form_type.dart';
import 'package:tmail_ui_user/main/exceptions/remote_exception.dart';
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
import 'package:tmail_ui_user/main/routes/route_navigation.dart';
import 'package:tmail_ui_user/main/utils/toast_manager.dart';
Expand Down Expand Up @@ -54,6 +55,10 @@ class LoginMessageWidget extends StatelessWidget {
} else if (failure is GetTokenOIDCFailure && failure.exception is NoSuitableBrowserForOIDCException) {
return AppLocalizations.of(context).noSuitableBrowserForOIDC;
} else if (failure is FeatureFailure) {
if (failure.exception is ConnectionError) {
return AppLocalizations.of(context).youAreOffline;
}

return _toastManager?.getMessageByException(context, failure.exception)
?? AppLocalizations.of(context).unknownError;
} else {
Expand Down
12 changes: 12 additions & 0 deletions lib/l10n/intl_messages.arb
Original file line number Diff line number Diff line change
Expand Up @@ -3993,5 +3993,17 @@
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"tryAgain": "Try again",
"@tryAgain": {
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"youAreOffline": "You are offline. It looks like you are not connected.",
"@youAreOffline": {
"type": "text",
"placeholders_order": [],
"placeholders": {}
}
}
13 changes: 10 additions & 3 deletions lib/main/localizations/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4188,10 +4188,17 @@ class AppLocalizations {
);
}

String get retry {
String get tryAgain {
return Intl.message(
'Retry',
name: 'retry',
'Try again',
name: 'tryAgain',
);
}

String get youAreOffline {
return Intl.message(
'You are offline. It looks like you are not connected.',
name: 'youAreOffline',
);
}
}

0 comments on commit 4bdeb9c

Please sign in to comment.