Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add error message if app permissions not granted #83

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { FormsModule } from '@angular/forms';
import { SwPush } from '@angular/service-worker';
import { Actions, ofType } from '@ngrx/effects';
import { Store } from '@ngrx/store';
import { MessageService } from 'primeng/api';
import { ButtonModule } from 'primeng/button';
import { CardModule } from 'primeng/card';
import { DropdownModule } from 'primeng/dropdown';
Expand Down Expand Up @@ -76,6 +77,7 @@ export class UserSettingsComponent {
private readonly _wellKnownService = inject(WellKnownService);
private readonly _actions$ = inject(Actions);
private readonly _swPush = inject(SwPush);
private readonly _messageService = inject(MessageService);

private readonly _loadActionState = selectSignal(selectUserSettingsActionState('load'));
private readonly _updateActionState = selectSignal(selectUserSettingsActionState('update'));
Expand Down Expand Up @@ -189,6 +191,12 @@ export class UserSettingsComponent {
} else {
this.resetNgModel.next();
this.isUpdatingPushSubscription.set(false);
this._messageService.add({
severity: 'error',
summary: this.translations.settings_notifications_errors_notGranted_title(),
detail: this.translations.settings_notifications_errors_notGranted_description(),
sticky: true,
});
}
});
} else {
Expand Down
8 changes: 7 additions & 1 deletion src/client/src/app/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
"title": "Benachrichtigungen",
"enabledOnAllDevices": "Auf allen Geräten aktiviert",
"eanbled": "Auf diesem Gerät aktiviert",
"errors": {
"notGranted": {
"title": "Erlaubnis über Benachrichtigungen nicht erteilt",
"description": "Um Benachrichtigungen erhalten zu können, musst du dies in den Systemeinstellungen aktivieren, oder die App erneut installieren."
}
},
"notify": {
"title": "Benachrichtigen, wenn...",
"eventPublish": "eine Veranstaltung veröffentlicht wird",
Expand Down Expand Up @@ -121,7 +127,7 @@
},
"commitDialog": {
"title": "Veranstaltung freigeben",
"text": "Möchtest du die Veranstlaung {{date}} wirklich freigeben? Die Zeitfenster können nicht mehr angepasst werden und die Spieler werden über ein neues Event benachrichtig"
"text": "Möchtest du die Veranstlaung {{date}} wirklich freigeben? Die Zeitfenster können nicht mehr angepasst werden und die Spieler werden über ein neues Event benachrichtigt"
},
"error": {
"load": "Fehler beim Laden der Veranstaltungen.",
Expand Down
6 changes: 6 additions & 0 deletions src/client/src/app/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
"title": "Notifications",
"enabledOnAllDevices": "Enabled on all devices",
"eanbled": "Enabled on this device",
"errors": {
"notGranted": {
"title": "Notification permission not granted",
"description": "To receive notifications, you must activate this in the system settings or reinstall the app."
}
},
"notify": {
"title": "Notify me when...",
"eventPublish": "an event is published",
Expand Down
2 changes: 1 addition & 1 deletion src/server/host/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"Url": "http://0.0.0.0:5000"
},
"Https": {
"Url": "https://0.0.0.0:5003"
"Url": "https://0.0.0.0:5001"
}
}
},
Expand Down
Loading