Merge pull request #5658 from matrix-org/travis/welcome-login
Add an optional config option to make the welcome page the login page
This commit is contained in:
commit
3caf07be87
2 changed files with 28 additions and 21 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2019 New Vector Ltd
|
||||
Copyright 2019, 2021 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.
|
||||
|
@ -14,12 +14,12 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
export function getHomePageUrl(appConfig) {
|
||||
import { ConfigOptions } from "../SdkConfig";
|
||||
|
||||
export function getHomePageUrl(appConfig: ConfigOptions): string | null {
|
||||
const pagesConfig = appConfig.embeddedPages;
|
||||
let pageUrl = null;
|
||||
if (pagesConfig) {
|
||||
pageUrl = pagesConfig.homeUrl;
|
||||
}
|
||||
let pageUrl = pagesConfig?.homeUrl;
|
||||
|
||||
if (!pageUrl) {
|
||||
// This is a deprecated config option for the home page
|
||||
// (despite the name, given we also now have a welcome
|
||||
|
@ -29,3 +29,8 @@ export function getHomePageUrl(appConfig) {
|
|||
|
||||
return pageUrl;
|
||||
}
|
||||
|
||||
export function shouldUseLoginForWelcome(appConfig: ConfigOptions): boolean {
|
||||
const pagesConfig = appConfig.embeddedPages;
|
||||
return pagesConfig?.loginForWelcome === true;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue