From 5f78522681c0ae51b2b6e22adabc0474f1aa352c Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 9 Jul 2020 18:20:57 +0100 Subject: [PATCH] Move the default brand into the config module --- src/SdkConfig.ts | 4 +++- src/components/structures/MatrixChat.tsx | 2 +- src/components/views/settings/Notifications.js | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/SdkConfig.ts b/src/SdkConfig.ts index 400d29a20f..6df63b10e8 100644 --- a/src/SdkConfig.ts +++ b/src/SdkConfig.ts @@ -1,6 +1,6 @@ /* Copyright 2016 OpenMarket Ltd -Copyright 2019 The Matrix.org Foundation C.I.C. +Copyright 2019, 2020 The Matrix.org Foundation C.I.C. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,6 +20,8 @@ export interface ConfigOptions { } export const DEFAULTS: ConfigOptions = { + // Brand name of the app + brand: "Riot", // URL to a page we show in an iframe to configure integrations integrations_ui_url: "https://scalar.vector.im/", // Base URL to the REST interface of the integrations server diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 89ee1bc22d..8115daa418 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -1819,7 +1819,7 @@ export default class MatrixChat extends React.PureComponent { } else { subtitle = `${this.subTitleStatus} ${subtitle}`; } - document.title = `${SdkConfig.get().brand || 'Riot'} ${subtitle}`; + document.title = `${SdkConfig.get().brand} ${subtitle}`; } updateStatusIndicator(state: string, prevState: string) { diff --git a/src/components/views/settings/Notifications.js b/src/components/views/settings/Notifications.js index a3173f18bb..0173132a28 100644 --- a/src/components/views/settings/Notifications.js +++ b/src/components/views/settings/Notifications.js @@ -1,5 +1,6 @@ /* Copyright 2016 OpenMarket Ltd +Copyright 2020 The Matrix.org Foundation C.I.C. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -154,7 +155,7 @@ export default createReactClass({ let emailPusherPromise; if (checked) { const data = {}; - data['brand'] = SdkConfig.get().brand || 'Riot'; + data['brand'] = SdkConfig.get().brand; emailPusherPromise = MatrixClientPeg.get().setPusher({ kind: 'email', app_id: 'm.email',