Skip to content

Commit 7078373

Browse files
authored
Support a config option to change the default device name (#20790)
1 parent cfa9721 commit 7078373

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

docs/config.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ For a good example, see https://develop.element.io/config.json.
166166
the well-known location is used instead.
167167
1. `analyticsOwner`: The entity that analytics data is being sent to. Used in copy
168168
when explaining to the user where data is being sent. If not set, defaults to `brand`.
169+
1. `defaultDeviceDisplayName`: The default device display name to use for new logins
170+
and registrations. If not set then a calculated version will be used.
169171

170172
Note that `index.html` also has an og:image meta tag that is set to an image
171173
hosted on riot.im. This is the image used if links to your copy of Element

src/vector/app.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ export async function loadApp(fragParams: {}) {
180180
return;
181181
}
182182

183+
const defaultDeviceName = config['defaultDeviceDisplayName'] ?? platform.getDefaultDeviceDisplayName();
184+
183185
const MatrixChat = sdk.getComponent('structures.MatrixChat');
184186
return <MatrixChat
185187
onNewScreen={onNewScreen}
@@ -190,7 +192,7 @@ export async function loadApp(fragParams: {}) {
190192
enableGuest={!config.disable_guests}
191193
onTokenLoginCompleted={onTokenLoginCompleted}
192194
initialScreenAfterLogin={getScreenFromLocation(window.location)}
193-
defaultDeviceDisplayName={platform.getDefaultDeviceDisplayName()}
195+
defaultDeviceDisplayName={defaultDeviceName}
194196
/>;
195197
}
196198

0 commit comments

Comments
 (0)