You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-30 02:21:17 +03:00
Add hosting_signup_domains for controlling which users see the hosting signup dialog
This commit is contained in:
@ -315,12 +315,19 @@ export default class UserMenu extends React.Component<IProps, IState> {
|
|||||||
const hostingSignupIFrame = SdkConfig.get().hosting_signup_iframe;
|
const hostingSignupIFrame = SdkConfig.get().hosting_signup_iframe;
|
||||||
let hostingIFrame;
|
let hostingIFrame;
|
||||||
if (hostingSignupIFrame) {
|
if (hostingSignupIFrame) {
|
||||||
hostingIFrame = <div
|
// If hosting_signup_domains is set to a non-empty array, only show
|
||||||
className="mx_UserMenu_contextMenu_header mx_UserMenu_contextMenu_hostingLink"
|
// dialog if the user is on the domain or a subdomain.
|
||||||
onClick={this.onCloseMenu}
|
const hostingSignupDomains = SdkConfig.get().hosting_signup_domains || [];
|
||||||
>
|
const mxDomain = MatrixClientPeg.get().getDomain();
|
||||||
<HostingProviderTrigger />
|
const validDomains = hostingSignupDomains.filter(d => (d === mxDomain || mxDomain.endsWith(`.${d}`)));
|
||||||
</div>;
|
if (!hostingSignupDomains || validDomains.length > 0) {
|
||||||
|
hostingIFrame = <div
|
||||||
|
className="mx_UserMenu_contextMenu_header mx_UserMenu_contextMenu_hostingLink"
|
||||||
|
onClick={this.onCloseMenu}
|
||||||
|
>
|
||||||
|
<HostingProviderTrigger />
|
||||||
|
</div>;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let homeButton = null;
|
let homeButton = null;
|
||||||
|
Reference in New Issue
Block a user