Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmer committed Feb 21, 2024
1 parent 2a51397 commit aefd8ca
Show file tree
Hide file tree
Showing 26 changed files with 457 additions and 312 deletions.
14 changes: 13 additions & 1 deletion lib/l10n/app_cs.arb
Original file line number Diff line number Diff line change
Expand Up @@ -561,5 +561,17 @@
"patchNotesDialogTitle": "Co je nového?",
"version": "Verze",
"noMailAppTitle": "Není nainstalována žádná e-mailová aplikace",
"noMailAppDescription": "There is no e-mail app installed or initialised on this device, please try again when you are able to send an email message."
"noMailAppDescription": "There is no e-mail app installed or initialised on this device, please try again when you are able to send an email message.",
"authenticationRequest": "Žádost o ověření",
"requestInfo": "Odesláno {issuer} pro váš účet: \"{account}\"",
"@requestInfo": {
"placeholders": {
"issuer": {
"example": "privacyIDEA"
},
"account": {
"example": "GitHub"
}
}
}
}
14 changes: 13 additions & 1 deletion lib/l10n/app_de.arb
Original file line number Diff line number Diff line change
Expand Up @@ -540,5 +540,17 @@
"patchNotesDialogTitle": "Was ist neu?",
"version": "Version",
"noMailAppTitle": "Keine Mail-App gefunden",
"noMailAppDescription": "Auf diesem Gerät ist keine E-Mail-App installiert oder initialisiert, bitte versuchen Sie es erneut, wenn Sie eine E-Mail-Nachricht senden können."
"noMailAppDescription": "Auf diesem Gerät ist keine E-Mail-App installiert oder initialisiert, bitte versuchen Sie es erneut, wenn Sie eine E-Mail-Nachricht senden können.",
"authenticationRequest": "Authentifizierung",
"requestInfo": "Gesendet von {issuer} für Ihr Konto: \"{account}\"",
"@requestInfo": {
"placeholders": {
"issuer": {
"example": "privacyIDEA"
},
"Konto": {
"example": "GitHub"
}
}
}
}
15 changes: 14 additions & 1 deletion lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -551,5 +551,18 @@
"patchNotesDialogTitle": "What's new?",
"version": "Version",
"noMailAppTitle": "No mail app found",
"noMailAppDescription": "There is no e-mail app installed or initialised on this device, please try again when you are able to send an email message."
"noMailAppDescription": "There is no e-mail app installed or initialised on this device, please try again when you are able to send an email message.",
"authenticationRequest": "Authentication request",
"requestInfo": "Sent by {issuer} for your account: \"{account}\"",
"@requestInfo": {
"description": "Description of the authentication request.",
"placeholders": {
"issuer": {
"example": "privacyIDEA"
},
"account": {
"example": "GitHub"
}
}
}
}
14 changes: 13 additions & 1 deletion lib/l10n/app_es.arb
Original file line number Diff line number Diff line change
Expand Up @@ -557,5 +557,17 @@
"patchNotesDialogTitle": "¿Qué hay de nuevo?",
"version": "Versión",
"noMailAppTitle": "No hay aplicación de correo electrónico",
"noMailAppDescription": "No hay ninguna app de correo electrónico instalada o inicializada en este dispositivo, inténtalo de nuevo cuando puedas enviar un mensaje de correo electrónico."
"noMailAppDescription": "No hay ninguna app de correo electrónico instalada o inicializada en este dispositivo, inténtalo de nuevo cuando puedas enviar un mensaje de correo electrónico.",
"authenticationRequest": "Autenticación",
"requestInfo": "Enviado por {issuer} para su cuenta: \"{account}\"",
"@requestInfo": {
"placeholders": {
"issuer": {
"example": "privacyIDEA"
},
"account": {
"example": "GitHub"
}
}
}
}
14 changes: 13 additions & 1 deletion lib/l10n/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -562,5 +562,17 @@
"patchNotesDialogTitle": "Quoi de neuf ?",
"version": "Version",
"noMailAppTitle": "Aucune application de messagerie trouvée",
"noMailAppDescription": "Aucune application de messagerie n'est installée ou initialisée sur cet appareil. Veuillez réessayer lorsque vous serez en mesure d'envoyer un message électronique."
"noMailAppDescription": "Aucune application de messagerie n'est installée ou initialisée sur cet appareil. Veuillez réessayer lorsque vous serez en mesure d'envoyer un message électronique.",
"authenticationRequest": "Authentification",
"requestInfo": "Envoyé par {issuer} pour votre compte : \"{account}\"",
"@requestInfo": {
"placeholders": {
"issuer": {
"exemple": "privacyIDEA"
},
"account": {
"exemple": "GitHub"
}
}
}
}
12 changes: 12 additions & 0 deletions lib/l10n/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1380,6 +1380,18 @@ abstract class AppLocalizations {
/// In en, this message translates to:
/// **'There is no e-mail app installed or initialised on this device, please try again when you are able to send an email message.'**
String get noMailAppDescription;

/// No description provided for @authenticationRequest.
///
/// In en, this message translates to:
/// **'Authentication request'**
String get authenticationRequest;

/// Description of the authentication request.
///
/// In en, this message translates to:
/// **'Sent by {issuer} for your account: \"{account}\"'**
String requestInfo(Object issuer, Object account);
}

class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
Expand Down
8 changes: 8 additions & 0 deletions lib/l10n/app_localizations_cs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -701,4 +701,12 @@ class AppLocalizationsCs extends AppLocalizations {

@override
String get noMailAppDescription => 'There is no e-mail app installed or initialised on this device, please try again when you are able to send an email message.';

@override
String get authenticationRequest => 'Žádost o ověření';

@override
String requestInfo(Object issuer, Object account) {
return 'Odesláno $issuer pro váš účet: \"$account\"';
}
}
8 changes: 8 additions & 0 deletions lib/l10n/app_localizations_de.dart
Original file line number Diff line number Diff line change
Expand Up @@ -701,4 +701,12 @@ class AppLocalizationsDe extends AppLocalizations {

@override
String get noMailAppDescription => 'Auf diesem Gerät ist keine E-Mail-App installiert oder initialisiert, bitte versuchen Sie es erneut, wenn Sie eine E-Mail-Nachricht senden können.';

@override
String get authenticationRequest => 'Authentifizierung';

@override
String requestInfo(Object issuer, Object account) {
return 'Gesendet von $issuer für Ihr Konto: \"$account\"';
}
}
8 changes: 8 additions & 0 deletions lib/l10n/app_localizations_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -701,4 +701,12 @@ class AppLocalizationsEn extends AppLocalizations {

@override
String get noMailAppDescription => 'There is no e-mail app installed or initialised on this device, please try again when you are able to send an email message.';

@override
String get authenticationRequest => 'Authentication request';

@override
String requestInfo(Object issuer, Object account) {
return 'Sent by $issuer for your account: \"$account\"';
}
}
8 changes: 8 additions & 0 deletions lib/l10n/app_localizations_es.dart
Original file line number Diff line number Diff line change
Expand Up @@ -701,4 +701,12 @@ class AppLocalizationsEs extends AppLocalizations {

@override
String get noMailAppDescription => 'No hay ninguna app de correo electrónico instalada o inicializada en este dispositivo, inténtalo de nuevo cuando puedas enviar un mensaje de correo electrónico.';

@override
String get authenticationRequest => 'Autenticación';

@override
String requestInfo(Object issuer, Object account) {
return 'Enviado por $issuer para su cuenta: \"$account\"';
}
}
8 changes: 8 additions & 0 deletions lib/l10n/app_localizations_fr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -701,4 +701,12 @@ class AppLocalizationsFr extends AppLocalizations {

@override
String get noMailAppDescription => 'Aucune application de messagerie n\'est installée ou initialisée sur cet appareil. Veuillez réessayer lorsque vous serez en mesure d\'envoyer un message électronique.';

@override
String get authenticationRequest => 'Authentification';

@override
String requestInfo(Object issuer, Object account) {
return 'Envoyé par $issuer pour votre compte : \"$account\"';
}
}
8 changes: 8 additions & 0 deletions lib/l10n/app_localizations_nl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -701,4 +701,12 @@ class AppLocalizationsNl extends AppLocalizations {

@override
String get noMailAppDescription => 'Er is geen e-mail app geïnstalleerd of geïnitialiseerd op dit apparaat, probeer het opnieuw wanneer u in staat bent om een e-mailbericht te verzenden.';

@override
String get authenticationRequest => 'Verificatieverzoek';

@override
String requestInfo(Object issuer, Object account) {
return 'Verzonden door $issuer voor uw account: \"$account\"';
}
}
8 changes: 8 additions & 0 deletions lib/l10n/app_localizations_pl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -701,4 +701,12 @@ class AppLocalizationsPl extends AppLocalizations {

@override
String get noMailAppDescription => 'Na tym urządzeniu nie zainstalowano ani nie zainicjowano aplikacji poczty e-mail, spróbuj ponownie, gdy będziesz w stanie wysłać wiadomość e-mail';

@override
String get authenticationRequest => 'Żądanie uwierzytelnienia';

@override
String requestInfo(Object issuer, Object account) {
return 'Wysłane przez $issuer dla twojego konta: \"$account\"';
}
}
14 changes: 13 additions & 1 deletion lib/l10n/app_nl.arb
Original file line number Diff line number Diff line change
Expand Up @@ -558,5 +558,17 @@
"patchNotesDialogTitle": "Wat is er nieuw?",
"version": "Versie",
"noMailAppTitle": "Geen mail app gevonden",
"noMailAppDescription": "Er is geen e-mail app geïnstalleerd of geïnitialiseerd op dit apparaat, probeer het opnieuw wanneer u in staat bent om een e-mailbericht te verzenden."
"noMailAppDescription": "Er is geen e-mail app geïnstalleerd of geïnitialiseerd op dit apparaat, probeer het opnieuw wanneer u in staat bent om een e-mailbericht te verzenden.",
"authenticationRequest": "Verificatieverzoek",
"requestInfo": "Verzonden door {issuer} voor uw account: \"{account}\"",
"@requestInfo": {
"placeholders": {
"issuer": {
"example": "privacyIDEA"
},
"account": {
"example": "GitHub"
}
}
}
}
14 changes: 13 additions & 1 deletion lib/l10n/app_pl.arb
Original file line number Diff line number Diff line change
Expand Up @@ -555,5 +555,17 @@
"patchNotesDialogTitle": "Co nowego?",
"version": "Wersja",
"noMailAppTitle": "Nie znaleziono aplikacji pocztowej",
"noMailAppDescription": "Na tym urządzeniu nie zainstalowano ani nie zainicjowano aplikacji poczty e-mail, spróbuj ponownie, gdy będziesz w stanie wysłać wiadomość e-mail"
"noMailAppDescription": "Na tym urządzeniu nie zainstalowano ani nie zainicjowano aplikacji poczty e-mail, spróbuj ponownie, gdy będziesz w stanie wysłać wiadomość e-mail",
"authenticationRequest": "Żądanie uwierzytelnienia",
"requestInfo": "Wysłane przez {issuer} dla twojego konta: \"{account}\"",
"@requestInfo": {
"placeholders": {
"issuer": {
"example": "privacyIDEA"
},
"account": {
"example": "GitHub"
}
}
}
}
4 changes: 0 additions & 4 deletions lib/model/states/token_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:flutter/material.dart';
import '../../utils/logger.dart';
import '../enums/push_token_rollout_state.dart';
import '../token_folder.dart';
import '../tokens/hotp_token.dart';
import '../tokens/otp_token.dart';
import '../tokens/push_token.dart';
import '../tokens/token.dart';
Expand All @@ -17,9 +16,6 @@ class TokenState {
List<OTPToken> get otpTokens => tokens.whereType<OTPToken>().toList();
bool get hasOTPTokens => otpTokens.isNotEmpty;

List<HOTPToken> get hotpTokens => tokens.whereType<HOTPToken>().toList();
bool get hasHOTPTokens => hotpTokens.isNotEmpty;

List<PushToken> get pushTokens => tokens.whereType<PushToken>().toList();
bool get hasPushTokens => pushTokens.isNotEmpty;
bool get hasRolledOutPushTokens => pushTokens.any((element) => element.isRolledOut);
Expand Down
11 changes: 10 additions & 1 deletion lib/state_notifiers/token_notifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ class TokenNotifier extends StateNotifier<TokenState> {
return state;
});
final failedTokens = (await loadingRepo).lastlyUpdatedTokens;
await _handlePushTokensIfExist();
return failedTokens.isEmpty;
}

Expand Down Expand Up @@ -563,7 +564,15 @@ class TokenNotifier extends StateNotifier<TokenState> {

Future<void> _handlePushTokensIfExist() async {
await loadingRepo;
if (state.hasRolledOutPushTokens) checkNotificationPermission();
if (state.hasPushTokens == false) {
if (globalRef?.read(settingsProvider).hidePushTokens == true) {
globalRef!.read(settingsProvider.notifier).setHidePushTokens(false);
}
return;
}
if (state.hasRolledOutPushTokens) {
checkNotificationPermission();
}
for (final element in state.pushTokensToRollOut) {
Logger.info('Handling push token "${element.id}"', name: 'token_notifier.dart#_handlePushTokensIfExist');
await rolloutPushToken(element);
Expand Down
1 change: 1 addition & 0 deletions lib/utils/globals.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Map<Version, Map<PatchNoteType, List<String>>> getLocalizedPatchNotes(AppLocaliz
final globalSnackbarKey = GlobalKey<ScaffoldMessengerState>();
final globalNavigatorKey = GlobalKey<NavigatorState>();
final Future<GlobalKey<NavigatorState>> contextedGlobalNavigatorKey = Future(() async => await _getContextedGlobalNavigatorKey());
final Future<BuildContext> globalContext = Future(() async => await _getContextedGlobalNavigatorKey()).then((value) => value.currentContext!);
Future<GlobalKey<NavigatorState>> _getContextedGlobalNavigatorKey() async {
if (globalNavigatorKey.currentContext != null) {
return globalNavigatorKey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class _MainViewTokensListState extends ConsumerState<MainViewTokensList> {
final tokenState = ref.watch(tokenProvider);
final allowToRefresh = tokenState.hasPushTokens;
final draggingSortable = ref.watch(draggingSortableProvider);
bool filterPushTokens = ref.watch(settingsProvider).hidePushTokens && tokenState.hasHOTPTokens;
bool filterPushTokens = ref.watch(settingsProvider).hidePushTokens && tokenState.hasOTPTokens;

final tokenStateWithNoFolder = tokenState.tokensWithoutFolder(exclude: filterPushTokens ? [PushToken] : []);

Expand Down
Loading

0 comments on commit aefd8ca

Please sign in to comment.