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

cumulative bugfix regarding the following issues: unhandled exception and incorrect unread message counter #3434

Closed
Closed
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
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## 11.0.0 (Unreleased)

- Fix: unhandled exception on new message arriving when user has not permitted playing audio in the browser
- Fix: incorrect unread messages counter badge on the application icon after switching to new XMPP user
- #1174: Show MUC avatars in the rooms list
- #1195: Add actions to quote and copy messages
- #1349: XEP-0392 Consistent Color Generation
Expand Down
7 changes: 5 additions & 2 deletions src/plugins/notifications/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function areDesktopNotificationsEnabled () {
*/

export function clearFavicon () {
favicon = null;
favicon?.badge(0);
/** @type navigator */(navigator).clearAppBadge?.()
.catch(e => log.error("Could not clear unread count in app badge " + e));
}
Expand Down Expand Up @@ -302,7 +302,10 @@ export async function handleMessageNotification (data) {
* @example _converse.api.listen.on('messageNotification', data => { ... });
*/
api.trigger('messageNotification', data);
playSoundNotification();
try{
// protection from exception: "play() failed because the user didn't interact with the document first" https://goo.gl/xX8pDD"
playSoundNotification();
} catch (error) {}
showMessageNotification(data);
}

Expand Down
Loading