Use separate config settings for each page

This commit is contained in:
J. Ryan Stinnett 2019-02-07 17:16:02 +00:00
parent 7cc38f9d96
commit c587dcab92
2 changed files with 15 additions and 2 deletions

View file

@ -459,8 +459,18 @@ const LoggedInView = React.createClass({
case PageTypes.HomePage: case PageTypes.HomePage:
{ {
const pagesConfig = this.props.config.pages;
let pageUrl;
if (pagesConfig) {
pageUrl = pagesConfig.homeUrl;
} else {
// This is a deprecated config option for the home page
// (despite the name, given we also now have a welcome
// page, which is not the same).
pageUrl = this.props.config.welcomePageUrl;
}
pageElement = <EmbeddedPage className="mx_HomePage" pageElement = <EmbeddedPage className="mx_HomePage"
url={this.props.config.welcomePageUrl || 'home.html'} url={pageUrl}
scrollbar={true} scrollbar={true}
/>; />;
} }

View file

@ -25,12 +25,15 @@ export default class Welcome extends React.PureComponent {
const AuthBody = sdk.getComponent("auth.AuthBody"); const AuthBody = sdk.getComponent("auth.AuthBody");
const EmbeddedPage = sdk.getComponent('structures.EmbeddedPage'); const EmbeddedPage = sdk.getComponent('structures.EmbeddedPage');
const pagesConfig = SdkConfig.get().pages;
const pageUrl = pagesConfig ? pagesConfig.welcomeUrl : 'welcome.html';
return ( return (
<AuthPage> <AuthPage>
<AuthHeader /> <AuthHeader />
<AuthBody> <AuthBody>
<EmbeddedPage className="mx_WelcomePage" <EmbeddedPage className="mx_WelcomePage"
url={SdkConfig.get().welcomePageUrl || 'home.html'} url={pageUrl}
/> />
</AuthBody> </AuthBody>
</AuthPage> </AuthPage>