From 715a4f8dac4040c07c9890ee55a378c775115e4f Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Wed, 15 Jul 2020 09:38:55 +0100 Subject: [PATCH] Restore device name --- src/vector/platform/WebPlatform.ts | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/vector/platform/WebPlatform.ts b/src/vector/platform/WebPlatform.ts index ec101600..2e739a26 100644 --- a/src/vector/platform/WebPlatform.ts +++ b/src/vector/platform/WebPlatform.ts @@ -173,21 +173,18 @@ export default class WebPlatform extends VectorBasePlatform { } getDefaultDeviceDisplayName(): string { - // TODO: Revert this after launch - // // strip query-string and fragment from uri - // const u = url.parse(window.location.href); - // u.protocol = ""; - // u.search = ""; - // u.hash = ""; - // // Remove trailing slash if present - // u.pathname = u.pathname.replace(/\/$/, ""); + // strip query-string and fragment from uri + const u = url.parse(window.location.href); + u.protocol = ""; + u.search = ""; + u.hash = ""; + // Remove trailing slash if present + u.pathname = u.pathname.replace(/\/$/, ""); - // let appName = u.format(); - // // Remove leading slashes if present - // appName = appName.replace(/^\/\//, ""); - // // `appName` is now in the format `develop.element.io`. - - const appName = "Riot Web"; + let appName = u.format(); + // Remove leading slashes if present + appName = appName.replace(/^\/\//, ""); + // `appName` is now in the format `develop.element.io`. const ua = new UAParser(); const browserName = ua.getBrowser().name || "unknown browser";