Eliminate the use of MatrixClientPeg in utils (#10910)

This commit is contained in:
Michael Telatynski 2023-05-23 16:24:12 +01:00 committed by GitHub
parent a0c2676c38
commit 30429df948
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
108 changed files with 409 additions and 325 deletions

View file

@ -115,7 +115,7 @@ export class IntegrationManagers {
private setupAccountManagers(): void {
if (!this.client || !this.client.getUserId()) return; // not logged in
const widgets = WidgetUtils.getIntegrationManagerWidgets();
const widgets = WidgetUtils.getIntegrationManagerWidgets(this.client);
widgets.forEach((w) => {
const data = w.content["data"];
if (!data) return;
@ -180,14 +180,6 @@ export class IntegrationManagers {
Modal.createDialog(IntegrationsDisabledDialog);
}
public async overwriteManagerOnAccount(manager: IntegrationManagerInstance): Promise<void> {
// TODO: TravisR - We should be logging out of scalar clients.
await WidgetUtils.removeIntegrationManagerWidgets();
// TODO: TravisR - We should actually be carrying over the discovery response verbatim.
await WidgetUtils.addIntegrationManagerWidget(manager.name, manager.uiUrl, manager.apiUrl);
}
/**
* Attempts to discover an integration manager using only its name. This will not validate that
* the integration manager is functional - that is the caller's responsibility.