Fix some regressions

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-09-20 17:15:36 +02:00
parent 0df67d005e
commit 459e028137
No known key found for this signature in database
GPG key ID: 55C211A1226CB17D
2 changed files with 11 additions and 1 deletions

View file

@ -146,7 +146,7 @@ export default class AppTile extends React.Component<IProps, IState> {
return {
initialising: true, // True while we are mangling the widget URL
// True while the iframe content is loading
loading: this.props.waitForIframeLoad,
loading: this.props.waitForIframeLoad && !PersistedElement.isMounted(this.persistKey),
// Assume that widget has permission to load if we are the user who
// added it to the room, or if explicitly granted by the user
hasPermissionToLoad: this.hasPermissionToLoad(newProps),
@ -247,6 +247,12 @@ export default class AppTile extends React.Component<IProps, IState> {
this.resetWidget(nextProps);
}
}
if (nextProps.widgetPageTitle !== this.props.widgetPageTitle) {
this.setState({
widgetPageTitle: nextProps.widgetPageTitle,
});
}
}
/**

View file

@ -104,6 +104,10 @@ export default class PersistedElement extends React.Component<IProps> {
}
}
static isMounted(persistKey) {
return Boolean(getContainer('mx_persistedElement_' + persistKey));
}
private collectChildContainer = (ref: HTMLDivElement): void => {
if (this.childContainer) {
this.resizeObserver.unobserve(this.childContainer);