fix: Push error message

This commit is contained in:
Christian Pauly 2022-11-04 13:49:23 +01:00
commit d473a9e663
4 changed files with 28 additions and 25 deletions

View file

@ -258,8 +258,11 @@ class BackgroundPush {
if (context == null) {
return;
}
if (await store.getItemBool(SettingKeys.showNoGoogle, true)) {
await loadLocale();
if (await store.getItemBool(SettingKeys.showNoGoogle, true) != true) {
return;
}
await loadLocale();
WidgetsBinding.instance.addPostFrameCallback((_) {
if (PlatformInfos.isAndroid) {
onFcmError?.call(
l10n!.noGoogleServicesWarning,
@ -267,13 +270,10 @@ class BackgroundPush {
AppConfig.enablePushTutorial,
),
);
return;
}
onFcmError?.call(l10n!.oopsPushError);
if (null == await store.getItem(SettingKeys.showNoGoogle)) {
await store.setItemBool(SettingKeys.showNoGoogle, false);
}
}
});
}
Future<void> setupFirebase() async {