From 459e0281370a9e164a97db3efee9122b46802262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Mon, 20 Sep 2021 17:15:36 +0200 Subject: [PATCH] Fix some regressions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/views/elements/AppTile.tsx | 8 +++++++- src/components/views/elements/PersistedElement.tsx | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/views/elements/AppTile.tsx b/src/components/views/elements/AppTile.tsx index 4ce85b0114..9ab7a91788 100644 --- a/src/components/views/elements/AppTile.tsx +++ b/src/components/views/elements/AppTile.tsx @@ -146,7 +146,7 @@ export default class AppTile extends React.Component { 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 { this.resetWidget(nextProps); } } + + if (nextProps.widgetPageTitle !== this.props.widgetPageTitle) { + this.setState({ + widgetPageTitle: nextProps.widgetPageTitle, + }); + } } /** diff --git a/src/components/views/elements/PersistedElement.tsx b/src/components/views/elements/PersistedElement.tsx index 8dda530097..d013091803 100644 --- a/src/components/views/elements/PersistedElement.tsx +++ b/src/components/views/elements/PersistedElement.tsx @@ -104,6 +104,10 @@ export default class PersistedElement extends React.Component { } } + static isMounted(persistKey) { + return Boolean(getContainer('mx_persistedElement_' + persistKey)); + } + private collectChildContainer = (ref: HTMLDivElement): void => { if (this.childContainer) { this.resizeObserver.unobserve(this.childContainer);