Convert HostingLink to TS

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pull/21833/head
Šimon Brandner 2021-09-26 15:03:50 +02:00
parent 755bfb4562
commit 0c6bf950f6
No known key found for this signature in database
GPG Key ID: 55C211A1226CB17D
1 changed files with 2 additions and 2 deletions

View File

@ -17,7 +17,7 @@ limitations under the License.
import SdkConfig from '../SdkConfig';
import { MatrixClientPeg } from '../MatrixClientPeg';
export function getHostingLink(campaign) {
export function getHostingLink(campaign: string): string {
const hostingLink = SdkConfig.get().hosting_signup_link;
if (!hostingLink) return null;
if (!campaign) return hostingLink;
@ -27,7 +27,7 @@ export function getHostingLink(campaign) {
try {
const hostingUrl = new URL(hostingLink);
hostingUrl.searchParams.set("utm_campaign", campaign);
return hostingUrl.format();
return hostingUrl.toString();
} catch (e) {
return hostingLink;
}