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

Commit 388d814

Browse files
authored
Merge pull request #1321 from matrix-org/rxl881/warnings
Only render appTile body (including warnings) if drawer shown.
2 parents e32c499 + 1862057 commit 388d814

File tree

1 file changed

+30
-28
lines changed

1 file changed

+30
-28
lines changed

src/components/views/elements/AppTile.js

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -223,42 +223,44 @@ export default React.createClass({
223223
safeWidgetUrl = url.format(parsedWidgetUrl);
224224
}
225225

226-
if (this.state.loading) {
227-
appTileBody = (
228-
<div className='mx_AppTileBody mx_AppLoading'>
229-
<MessageSpinner msg='Loading...'/>
230-
</div>
231-
);
232-
} else if (this.state.hasPermissionToLoad == true) {
233-
if (this.isMixedContent()) {
226+
if (this.props.show) {
227+
if (this.state.loading) {
234228
appTileBody = (
235-
<div className="mx_AppTileBody">
236-
<AppWarning
237-
errorMsg="Error - Mixed content"
238-
/>
229+
<div className='mx_AppTileBody mx_AppLoading'>
230+
<MessageSpinner msg='Loading...'/>
239231
</div>
240232
);
241-
} else if (this.props.show) {
233+
} else if (this.state.hasPermissionToLoad == true) {
234+
if (this.isMixedContent()) {
235+
appTileBody = (
236+
<div className="mx_AppTileBody">
237+
<AppWarning
238+
errorMsg="Error - Mixed content"
239+
/>
240+
</div>
241+
);
242+
} else {
243+
appTileBody = (
244+
<div className="mx_AppTileBody">
245+
<iframe
246+
ref="appFrame"
247+
src={safeWidgetUrl}
248+
allowFullScreen="true"
249+
sandbox={sandboxFlags}
250+
></iframe>
251+
</div>
252+
);
253+
}
254+
} else {
242255
appTileBody = (
243256
<div className="mx_AppTileBody">
244-
<iframe
245-
ref="appFrame"
246-
src={safeWidgetUrl}
247-
allowFullScreen="true"
248-
sandbox={sandboxFlags}
249-
></iframe>
257+
<AppPermission
258+
url={this.state.widgetUrl}
259+
onPermissionGranted={this._grantWidgetPermission}
260+
/>
250261
</div>
251262
);
252263
}
253-
} else {
254-
appTileBody = (
255-
<div className="mx_AppTileBody">
256-
<AppPermission
257-
url={this.state.widgetUrl}
258-
onPermissionGranted={this._grantWidgetPermission}
259-
/>
260-
</div>
261-
);
262264
}
263265

264266
// editing is done in scalar

0 commit comments

Comments
 (0)