From dec5ea16377fa5891eb03af6fefbd4c9752a857d Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 30 Apr 2020 15:58:53 +0100 Subject: [PATCH 1/2] Tweak default device name on macOS This tweak's the OS name in the default device name for macOS devices to match Apple's current branding. Fixes https://github.com/vector-im/riot-web/issues/13459 --- src/vector/platform/WebPlatform.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vector/platform/WebPlatform.js b/src/vector/platform/WebPlatform.js index f89efad54d..fb95831808 100644 --- a/src/vector/platform/WebPlatform.js +++ b/src/vector/platform/WebPlatform.js @@ -186,7 +186,9 @@ export default class WebPlatform extends VectorBasePlatform { const ua = new UAParser(); const browserName = ua.getBrowser().name || "unknown browser"; - const osName = ua.getOS().name || "unknown os"; + let osName = ua.getOS().name || "unknown OS"; + // Stylise the value from the parser to match Apple's current branding. + if (osName === "Mac OS") osName = "macOS"; return _t('%(appName)s via %(browserName)s on %(osName)s', {appName: appName, browserName: browserName, osName: osName}); } From ab40d5b73239fceffc3c96ca64c51940c0f03b54 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 30 Apr 2020 16:02:37 +0100 Subject: [PATCH 2/2] Update copyright header --- src/vector/platform/WebPlatform.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vector/platform/WebPlatform.js b/src/vector/platform/WebPlatform.js index fb95831808..ec70ee2646 100644 --- a/src/vector/platform/WebPlatform.js +++ b/src/vector/platform/WebPlatform.js @@ -3,6 +3,7 @@ /* Copyright 2016 Aviral Dasgupta Copyright 2016 OpenMarket Ltd +Copyright 2017-2020 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.