Intercept cases of disabled/no integration managers
We already intercepted most of the cases where no integration manager was present, though there was a bug in many components where openAll() would be called regardless of an integration manager being available. The integration manager being disabled by the user is handled in the IntegrationManager classes rather than on click because we have quite a few calls to these functions. The StickerPicker is an exception because it does slightly different behaviour. This also removes the old "no integration manager configured" state from the IntegrationManager component as it is now replaced by a dialog.
This commit is contained in:
@@ -20,6 +20,8 @@ import {dialogTermsInteractionCallback, TermsNotSignedError} from "../Terms";
|
||||
import type {Room} from "matrix-js-sdk";
|
||||
import Modal from '../Modal';
|
||||
import url from 'url';
|
||||
import SettingsStore from "../settings/SettingsStore";
|
||||
import {IntegrationManagers} from "./IntegrationManagers";
|
||||
|
||||
export const KIND_ACCOUNT = "account";
|
||||
export const KIND_CONFIG = "config";
|
||||
@@ -57,6 +59,10 @@ export class IntegrationManagerInstance {
|
||||
}
|
||||
|
||||
async open(room: Room = null, screen: string = null, integrationId: string = null): void {
|
||||
if (!SettingsStore.getValue("integrationProvisioning")) {
|
||||
return IntegrationManagers.sharedInstance().showDisabledDialog();
|
||||
}
|
||||
|
||||
const IntegrationManager = sdk.getComponent("views.settings.IntegrationManager");
|
||||
const dialog = Modal.createTrackedDialog(
|
||||
'Integration Manager', '', IntegrationManager,
|
||||
|
||||
Reference in New Issue
Block a user