Skip to content

Commit f4192e4

Browse files
authored
Merge pull request element-hq#9909 from vector-im/matthew/low_bandwidth
Low bandwidth mode
2 parents fcf8e24 + c5461b4 commit f4192e4

4 files changed

Lines changed: 16 additions & 17 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ For a good example, see https://riot.im/develop/config.json.
134134
in the `labs` section of settings. The available optional experimental features vary from
135135
release to release. Some of the available features are described in the Labs Feature section
136136
of this README.
137+
1. `showLabsSettings`: Shows the "labs" tab of user settings even when no `features` are enabled
138+
or present. Useful for getting at settings which may be otherwise hidden.
137139
1. `brand`: String to pass to your homeserver when configuring email notifications, to let the
138140
homeserver know what email template to use when talking to you.
139141
1. `branding`: Configures various branding and logo details, such as:

‎config.sample.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"integrations_rest_url": "https://scalar.vector.im/api",
1919
"integrations_jitsi_widget_url": "https://scalar.vector.im/api/widgets/jitsi.html",
2020
"bug_report_endpoint_url": "https://riot.im/bugreports/submit",
21+
"showLabsSettings": false,
2122
"features": {
2223
"feature_groups": "labs",
2324
"feature_pinning": "labs",

‎src/vector/platform/ElectronPlatform.js‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,12 @@ export default class ElectronPlatform extends VectorBasePlatform {
141141
}
142142

143143
// Notifications in Electron use the HTML5 notification API
144-
const notification = new global.Notification(
145-
title,
146-
{
147-
body: msg,
148-
icon: avatarUrl,
149-
silent: true, // we play our own sounds
150-
},
151-
);
144+
const notifBody = {
145+
body: msg,
146+
silent: true, // we play our own sounds
147+
};
148+
if (avatarUrl) notifBody['icon'] = avatarUrl;
149+
const notification = new global.Notification(title, notifBody);
152150

153151
notification.onclick = () => {
154152
dis.dispatch({

‎src/vector/platform/WebPlatform.js‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,13 @@ export default class WebPlatform extends VectorBasePlatform {
7676
}
7777

7878
displayNotification(title: string, msg: string, avatarUrl: string, room: Object) {
79-
const notification = new global.Notification(
80-
title,
81-
{
82-
body: msg,
83-
icon: avatarUrl,
84-
tag: "vector",
85-
silent: true, // we play our own sounds
86-
},
87-
);
79+
const notifBody = {
80+
body: msg,
81+
tag: "vector",
82+
silent: true, // we play our own sounds
83+
};
84+
if (avatarUrl) notifBody['icon'] = avatarUrl;
85+
const notification = new global.Notification(title, notifBody);
8886

8987
notification.onclick = function() {
9088
dis.dispatch({

0 commit comments

Comments
 (0)