Merge pull request #1321 from matrix-org/rxl881/warnings

Only render appTile body (including warnings) if drawer shown.
This commit is contained in:
Richard Lewis 2017-08-18 18:43:21 +01:00 committed by GitHub
commit 388d8141ae

View file

@ -223,42 +223,44 @@ export default React.createClass({
safeWidgetUrl = url.format(parsedWidgetUrl); safeWidgetUrl = url.format(parsedWidgetUrl);
} }
if (this.state.loading) { if (this.props.show) {
appTileBody = ( if (this.state.loading) {
<div className='mx_AppTileBody mx_AppLoading'> appTileBody = (
<MessageSpinner msg='Loading...'/> <div className='mx_AppTileBody mx_AppLoading'>
</div> <MessageSpinner msg='Loading...'/>
); </div>
} else if (this.state.hasPermissionToLoad == true) { );
if (this.isMixedContent()) { } else if (this.state.hasPermissionToLoad == true) {
if (this.isMixedContent()) {
appTileBody = (
<div className="mx_AppTileBody">
<AppWarning
errorMsg="Error - Mixed content"
/>
</div>
);
} else {
appTileBody = (
<div className="mx_AppTileBody">
<iframe
ref="appFrame"
src={safeWidgetUrl}
allowFullScreen="true"
sandbox={sandboxFlags}
></iframe>
</div>
);
}
} else {
appTileBody = ( appTileBody = (
<div className="mx_AppTileBody"> <div className="mx_AppTileBody">
<AppWarning <AppPermission
errorMsg="Error - Mixed content" url={this.state.widgetUrl}
onPermissionGranted={this._grantWidgetPermission}
/> />
</div> </div>
); );
} else if (this.props.show) {
appTileBody = (
<div className="mx_AppTileBody">
<iframe
ref="appFrame"
src={safeWidgetUrl}
allowFullScreen="true"
sandbox={sandboxFlags}
></iframe>
</div>
);
} }
} else {
appTileBody = (
<div className="mx_AppTileBody">
<AppPermission
url={this.state.widgetUrl}
onPermissionGranted={this._grantWidgetPermission}
/>
</div>
);
} }
// editing is done in scalar // editing is done in scalar