You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
Support changing your integration manager in the UI
Part of https://github.com/vector-im/riot-web/issues/10161
This commit is contained in:
@@ -19,12 +19,18 @@ import sdk from "../index";
|
||||
import {dialogTermsInteractionCallback, TermsNotSignedError} from "../Terms";
|
||||
import type {Room} from "matrix-js-sdk";
|
||||
import Modal from '../Modal';
|
||||
import url from 'url';
|
||||
|
||||
export const KIND_ACCOUNT = "account";
|
||||
export const KIND_CONFIG = "config";
|
||||
|
||||
export class IntegrationManagerInstance {
|
||||
apiUrl: string;
|
||||
uiUrl: string;
|
||||
kind: string;
|
||||
|
||||
constructor(apiUrl: string, uiUrl: string) {
|
||||
constructor(kind: string, apiUrl: string, uiUrl: string) {
|
||||
this.kind = kind;
|
||||
this.apiUrl = apiUrl;
|
||||
this.uiUrl = uiUrl;
|
||||
|
||||
@@ -32,6 +38,11 @@ export class IntegrationManagerInstance {
|
||||
if (!this.uiUrl) this.uiUrl = this.apiUrl;
|
||||
}
|
||||
|
||||
get name(): string {
|
||||
const parsed = url.parse(this.uiUrl);
|
||||
return parsed.hostname;
|
||||
}
|
||||
|
||||
getScalarClient(): ScalarAuthClient {
|
||||
return new ScalarAuthClient(this.apiUrl, this.uiUrl);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user