This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
src/components/views/settings Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments