forked from matrix/element-web
Don't try and render null avatars in desktop notifications
as much fun as http://localhost:8080/null is to see
This commit is contained in:
parent
98f2d865b9
commit
c5461b4509
|
@ -141,14 +141,12 @@ export default class ElectronPlatform extends VectorBasePlatform {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notifications in Electron use the HTML5 notification API
|
// Notifications in Electron use the HTML5 notification API
|
||||||
const notification = new global.Notification(
|
const notifBody = {
|
||||||
title,
|
|
||||||
{
|
|
||||||
body: msg,
|
body: msg,
|
||||||
icon: avatarUrl,
|
|
||||||
silent: true, // we play our own sounds
|
silent: true, // we play our own sounds
|
||||||
},
|
};
|
||||||
);
|
if (avatarUrl) notifBody['icon'] = avatarUrl;
|
||||||
|
const notification = new global.Notification(title, notifBody);
|
||||||
|
|
||||||
notification.onclick = () => {
|
notification.onclick = () => {
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
|
|
|
@ -76,15 +76,13 @@ export default class WebPlatform extends VectorBasePlatform {
|
||||||
}
|
}
|
||||||
|
|
||||||
displayNotification(title: string, msg: string, avatarUrl: string, room: Object) {
|
displayNotification(title: string, msg: string, avatarUrl: string, room: Object) {
|
||||||
const notification = new global.Notification(
|
const notifBody = {
|
||||||
title,
|
|
||||||
{
|
|
||||||
body: msg,
|
body: msg,
|
||||||
icon: avatarUrl,
|
|
||||||
tag: "vector",
|
tag: "vector",
|
||||||
silent: true, // we play our own sounds
|
silent: true, // we play our own sounds
|
||||||
},
|
};
|
||||||
);
|
if (avatarUrl) notifBody['icon'] = avatarUrl;
|
||||||
|
const notification = new global.Notification(title, notifBody);
|
||||||
|
|
||||||
notification.onclick = function() {
|
notification.onclick = function() {
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
|
|
Loading…
Reference in New Issue