Skip to content

Commit ee76b47

Browse files
committed
Prevent prompting again on after errors
1 parent 6a7000e commit ee76b47

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

styles/all/template/webpush.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,11 @@ function PhpbbWebpush() {
281281
phpbb.alert(ajaxErrorTitle, error);
282282
});
283283
} catch (error) {
284+
promptDenied.set(); // deny the prompt on error to prevent repeated prompting
285+
const popup = document.getElementById('wpn_popup_prompt');
286+
if (popup) {
287+
popup.style.display = 'none';
288+
}
284289
console.error('Push subscription error:', error);
285290
phpbb.alert(subscribeButton.getAttribute('data-l-err'), error.message || subscribeButton.getAttribute('data-disabled-msg'));
286291
}

0 commit comments

Comments
 (0)