WIP
This commit is contained in:
parent
b991e06b85
commit
0933fb885c
|
@ -277,7 +277,7 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
|||
|
||||
@override
|
||||
void didChangeAppLifecycleState(AppLifecycleState state) async {
|
||||
await LocalizationService.processLocals(context);
|
||||
if(state == AppLifecycleState.resumed) await _initializeNotificationService();
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// ignore_for_file: curly_braces_in_flow_control_structures
|
||||
// ignore_for_file: curly_braces_in_flow_control_structures, use_build_context_synchronously, unrelated_type_equality_checks
|
||||
|
||||
import 'dart:developer';
|
||||
|
||||
|
@ -204,14 +204,6 @@ class LocalizationService {
|
|||
final bool isAuthenticated = userUUID.isNotEmpty && devUUID.isNotEmpty;
|
||||
final bool isDevLinked = !errorMsg.contains('Esse dispositivo nao pertence a esse usuario');
|
||||
log('() => isLinked: $errorMsg');
|
||||
if (isAuthenticated && isDevLinked) await DialogUtil.error(context, errorMsg).whenComplete(() async => await selectLocal(context));
|
||||
if (isAuthenticated && !isDevLinked) {
|
||||
errorMsg = FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Não foi possível vincular o dispositivo, tente novamente',
|
||||
enText: 'Unable to link device, try again',
|
||||
);
|
||||
await DialogUtil.warning(context, errorMsg);
|
||||
}
|
||||
if (!isAuthenticated) {
|
||||
errorMsg = FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Erro ao obter credenciais de autenticação',
|
||||
|
@ -220,6 +212,15 @@ class LocalizationService {
|
|||
await DialogUtil.error(context, errorMsg);
|
||||
// await DialogUtil.error(context, errorMsg).whenComplete(() async => await AuthenticationService.signOut(context));
|
||||
}
|
||||
else if (isAuthenticated && !isDevLinked) {
|
||||
errorMsg = FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Não foi possível vincular o dispositivo, tente novamente',
|
||||
enText: 'Unable to link device, try again',
|
||||
);
|
||||
await DialogUtil.warning(context, errorMsg);
|
||||
}
|
||||
else if (isAuthenticated && isDevLinked) await DialogUtil.error(context, errorMsg).whenComplete(() async => await selectLocal(context));
|
||||
|
||||
}
|
||||
|
||||
static Future<bool> _handleUnavailable(BuildContext context, List<dynamic> locals) async {
|
||||
|
|
Loading…
Reference in New Issue