Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 3a0833e

Browse files
authored
Merge pull request #5328 from matrix-org/t3chguy/fix/14718
Show Integrations error if iframe failed to load too
2 parents ce8a4c0 + 999d83c commit 3a0833e

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/components/views/settings/IntegrationManager.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ export default class IntegrationManager extends React.Component {
4242
loading: false,
4343
};
4444

45+
constructor(props) {
46+
super(props);
47+
48+
this.state = {
49+
errored: false,
50+
};
51+
}
52+
4553
componentDidMount() {
4654
this.dispatcherRef = dis.register(this.onAction);
4755
document.addEventListener("keydown", this.onKeyDown);
@@ -66,6 +74,10 @@ export default class IntegrationManager extends React.Component {
6674
}
6775
};
6876

77+
onError = () => {
78+
this.setState({ errored: true });
79+
};
80+
6981
render() {
7082
if (this.props.loading) {
7183
const Spinner = sdk.getComponent("elements.Spinner");
@@ -77,7 +89,7 @@ export default class IntegrationManager extends React.Component {
7789
);
7890
}
7991

80-
if (!this.props.connected) {
92+
if (!this.props.connected || this.state.errored) {
8193
return (
8294
<div className='mx_IntegrationManager_error'>
8395
<h3>{_t("Cannot connect to integration manager")}</h3>
@@ -86,6 +98,6 @@ export default class IntegrationManager extends React.Component {
8698
);
8799
}
88100

89-
return <iframe src={this.props.url}></iframe>;
101+
return <iframe src={this.props.url} onError={this.onError} />;
90102
}
91103
}

0 commit comments

Comments
 (0)