mirror of
https://github.com/element-hq/element-web
synced 2024-11-24 18:25:49 +03:00
Fix persisted widgets getting stuck at loading screens
The widget itself is rendered underneath the loading screen, so we just have to disable the loading state. This commit also removes the "is" attribute because React 16 includes unknown attributes: https://reactjs.org/blog/2017/09/08/dom-attributes-in-react-16.html Fixes https://github.com/vector-im/riot-web/issues/11536
This commit is contained in:
parent
fbba55ab05
commit
7b013ecc69
1 changed files with 3 additions and 6 deletions
|
@ -36,6 +36,7 @@ import classNames from 'classnames';
|
||||||
import {IntegrationManagers} from "../../../integrations/IntegrationManagers";
|
import {IntegrationManagers} from "../../../integrations/IntegrationManagers";
|
||||||
import SettingsStore, {SettingLevel} from "../../../settings/SettingsStore";
|
import SettingsStore, {SettingLevel} from "../../../settings/SettingsStore";
|
||||||
import {createMenu} from "../../structures/ContextualMenu";
|
import {createMenu} from "../../structures/ContextualMenu";
|
||||||
|
import PersistedElement from "./PersistedElement";
|
||||||
|
|
||||||
const ALLOWED_APP_URL_SCHEMES = ['https:', 'http:'];
|
const ALLOWED_APP_URL_SCHEMES = ['https:', 'http:'];
|
||||||
const ENABLE_REACT_PERF = false;
|
const ENABLE_REACT_PERF = false;
|
||||||
|
@ -247,7 +248,8 @@ export default class AppTile extends React.Component {
|
||||||
this.setScalarToken();
|
this.setScalarToken();
|
||||||
}
|
}
|
||||||
} else if (nextProps.show && !this.props.show) {
|
} else if (nextProps.show && !this.props.show) {
|
||||||
if (this.props.waitForIframeLoad) {
|
// We assume that persisted widgets are loaded and don't need a spinner.
|
||||||
|
if (this.props.waitForIframeLoad && !PersistedElement.isMounted(this._persistKey)) {
|
||||||
this.setState({
|
this.setState({
|
||||||
loading: true,
|
loading: true,
|
||||||
});
|
});
|
||||||
|
@ -652,12 +654,7 @@ export default class AppTile extends React.Component {
|
||||||
appTileBody = (
|
appTileBody = (
|
||||||
<div className={appTileBodyClass + (this.state.loading ? 'mx_AppLoading' : '')}>
|
<div className={appTileBodyClass + (this.state.loading ? 'mx_AppLoading' : '')}>
|
||||||
{ this.state.loading && loadingElement }
|
{ this.state.loading && loadingElement }
|
||||||
{ /*
|
|
||||||
The "is" attribute in the following iframe tag is needed in order to enable rendering of the
|
|
||||||
"allow" attribute, which is unknown to react 15.
|
|
||||||
*/ }
|
|
||||||
<iframe
|
<iframe
|
||||||
is
|
|
||||||
allow={iframeFeatures}
|
allow={iframeFeatures}
|
||||||
ref="appFrame"
|
ref="appFrame"
|
||||||
src={this._getSafeUrl()}
|
src={this._getSafeUrl()}
|
||||||
|
|
Loading…
Reference in a new issue