mirror of https://github.com/vector-im/riot-web
Only show hosting link if domain == matrix.org
Fixes https://github.com/vector-im/riot-web/issues/9059pull/21833/head
parent
a9402beb8f
commit
610a6d935a
|
@ -18,12 +18,15 @@ import url from 'url';
|
||||||
import qs from 'qs';
|
import qs from 'qs';
|
||||||
|
|
||||||
import SdkConfig from '../SdkConfig';
|
import SdkConfig from '../SdkConfig';
|
||||||
|
import MatrixClientPeg from '../MatrixClientPeg';
|
||||||
|
|
||||||
export function getHostingLink(campaign) {
|
export function getHostingLink(campaign) {
|
||||||
const hostingLink = SdkConfig.get().hosting_signup_link;
|
const hostingLink = SdkConfig.get().hosting_signup_link;
|
||||||
if (!hostingLink) return null;
|
if (!hostingLink) return null;
|
||||||
if (!campaign) return hostingLink;
|
if (!campaign) return hostingLink;
|
||||||
|
|
||||||
|
if (MatrixClientPeg.get().getDomain() !== 'matrix.org') return null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const hostingUrl = url.parse(hostingLink);
|
const hostingUrl = url.parse(hostingLink);
|
||||||
const params = qs.parse(hostingUrl.query);
|
const params = qs.parse(hostingUrl.query);
|
||||||
|
|
Loading…
Reference in New Issue