Fix various loadingElement related issues.

This commit is contained in:
Richard Lewis 2017-11-08 20:38:31 +00:00
parent b2b07d9370
commit 56581ef408

View file

@ -312,24 +312,24 @@ export default React.createClass({
} }
if (this.props.show) { if (this.props.show) {
if (this.state.initialising) { const loadingElement = (
appTileBody = (
<div className='mx_AppTileBody mx_AppLoading'> <div className='mx_AppTileBody mx_AppLoading'>
<MessageSpinner msg='Loading...' /> <MessageSpinner msg='Loading...' />
</div> </div>
); );
if (this.state.initialising) {
appTileBody = loadingElement;
} else if (this.state.hasPermissionToLoad == true) { } else if (this.state.hasPermissionToLoad == true) {
const loadingElement = ( if (this.isMixedContent()) {
appTileBody = (
<div className="mx_AppTileBody"> <div className="mx_AppTileBody">
<AppWarning errorMsg="Error - Mixed content" /> <AppWarning errorMsg="Error - Mixed content" />
</div> </div>
); );
if (this.isMixedContent()) {
appTileBody = loadingElement;
} else { } else {
appTileBody = ( appTileBody = (
<div className={this.loading ? 'mx_AppTileBody mx_AppLoading' : 'mx_AppTileBody'}> <div className={this.state.loading ? 'mx_AppTileBody mx_AppLoading' : 'mx_AppTileBody'}>
{ this.loading && Element } { this.loading && loadingElement }
<iframe <iframe
ref="appFrame" ref="appFrame"
src={safeWidgetUrl} src={safeWidgetUrl}