Skip to content

Commit c7486c6

Browse files
committed
More appropriate fallback error message from lang system
1 parent b718261 commit c7486c6

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

styles/all/template/event/notification_dropdown_footer_after.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% if NOTIFICATIONS_WEBPUSH_ENABLE and notification_types is not defined %}
22
<div class="wpn-notification-dropdown-footer" title="{{ lang('NOTIFY_WEBPUSH_DROPDOWN_TITLE') }}">
33
<span class="ellipsis-text">{{ lang('NOTIFY_WEBPUSH_ENABLE_SLIDER') ~ lang('COLON') }}</span>
4-
<button id="subscribe_webpush" name="subscribe_webpush" data-l-err="{{ lang('INFORMATION') }}" data-l-msg="{{ lang('NOTIFY_WEBPUSH_DENIED') }}">
4+
<button id="subscribe_webpush" name="subscribe_webpush" data-l-err="{{ lang('INFORMATION') }}" data-l-msg="{{ lang('NOTIFY_WEBPUSH_DENIED') }}" data-disabled-msg="{{ lang('NOTIFY_WEBPUSH_DISABLED') }}">
55
<i class="icon fa-toggle-off fa-fw icon-lightgray" aria-hidden="true" title="{{ lang('NOTIFY_WEBPUSH_SUBSCRIBE') }}"><span class="sr-only">{{ lang('NOTIFY_WEBPUSH_SUBSCRIBE') }}</span></i>
66
</button>
77
<button id="unsubscribe_webpush" name="unsubscribe_webpush" class="hidden">

styles/all/template/webpush.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ function PhpbbWebpush() {
280280
});
281281
} catch (error) {
282282
console.error('Push subscription error:', error);
283-
phpbb.alert(subscribeButton.getAttribute('data-l-err'), subscribeButton.getAttribute('data-l-msg'));
283+
phpbb.alert(subscribeButton.getAttribute('data-l-err'), error.message || subscribeButton.getAttribute('data-disabled-msg'));
284284
}
285285
}
286286

0 commit comments

Comments
 (0)