Move the default brand into the config module

This commit is contained in:
J. Ryan Stinnett 2020-07-09 18:20:57 +01:00
parent 7686039874
commit 5f78522681
3 changed files with 6 additions and 3 deletions

View file

@ -1,6 +1,6 @@
/* /*
Copyright 2016 OpenMarket Ltd 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"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with 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 = { export const DEFAULTS: ConfigOptions = {
// Brand name of the app
brand: "Riot",
// URL to a page we show in an iframe to configure integrations // URL to a page we show in an iframe to configure integrations
integrations_ui_url: "https://scalar.vector.im/", integrations_ui_url: "https://scalar.vector.im/",
// Base URL to the REST interface of the integrations server // Base URL to the REST interface of the integrations server

View file

@ -1819,7 +1819,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
} else { } else {
subtitle = `${this.subTitleStatus} ${subtitle}`; subtitle = `${this.subTitleStatus} ${subtitle}`;
} }
document.title = `${SdkConfig.get().brand || 'Riot'} ${subtitle}`; document.title = `${SdkConfig.get().brand} ${subtitle}`;
} }
updateStatusIndicator(state: string, prevState: string) { updateStatusIndicator(state: string, prevState: string) {

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2016 OpenMarket Ltd Copyright 2016 OpenMarket Ltd
Copyright 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -154,7 +155,7 @@ export default createReactClass({
let emailPusherPromise; let emailPusherPromise;
if (checked) { if (checked) {
const data = {}; const data = {};
data['brand'] = SdkConfig.get().brand || 'Riot'; data['brand'] = SdkConfig.get().brand;
emailPusherPromise = MatrixClientPeg.get().setPusher({ emailPusherPromise = MatrixClientPeg.get().setPusher({
kind: 'email', kind: 'email',
app_id: 'm.email', app_id: 'm.email',