Skip to content

Commit 0fa2941

Browse files
committed
Use a safe but sane device name
1 parent f70f3c7 commit 0fa2941

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

src/vector/platform/WebPlatform.ts

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -173,20 +173,21 @@ export default class WebPlatform extends VectorBasePlatform {
173173
}
174174

175175
getDefaultDeviceDisplayName(): string {
176-
return "unknown browser " + Math.round(Number.MAX_SAFE_INTEGER * Math.random());
177-
178-
// strip query-string and fragment from uri
179-
const u = url.parse(window.location.href);
180-
u.protocol = "";
181-
u.search = "";
182-
u.hash = "";
183-
// Remove trailing slash if present
184-
u.pathname = u.pathname.replace(/\/$/, "");
185-
186-
let appName = u.format();
187-
// Remove leading slashes if present
188-
appName = appName.replace(/^\/\//, "");
189-
// `appName` is now in the format `develop.element.io`.
176+
// TODO: Revert this after launch
177+
// // strip query-string and fragment from uri
178+
// const u = url.parse(window.location.href);
179+
// u.protocol = "";
180+
// u.search = "";
181+
// u.hash = "";
182+
// // Remove trailing slash if present
183+
// u.pathname = u.pathname.replace(/\/$/, "");
184+
185+
// let appName = u.format();
186+
// // Remove leading slashes if present
187+
// appName = appName.replace(/^\/\//, "");
188+
// // `appName` is now in the format `develop.element.io`.
189+
190+
const appName = "Riot Web";
190191

191192
const ua = new UAParser();
192193
const browserName = ua.getBrowser().name || "unknown browser";

0 commit comments

Comments
 (0)