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

Element Call: fix widget shown while its still loading (waitForIframeLoad=false) #12292

Merged
merged 9 commits into from
Mar 12, 2024
2 changes: 1 addition & 1 deletion src/components/views/elements/AppTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,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 && !PersistedElement.isMounted(this.persistKey),
loading: !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),
Expand Down
2 changes: 1 addition & 1 deletion src/models/Call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ export class ElementCall extends Call {
name: "Element Call",
type: WidgetType.CALL.preferred,
url: url.toString(),
// waitForIframeLoad: false,
waitForIframeLoad: false,
data: ElementCall.getWidgetData(
client,
roomId,
Expand Down
5 changes: 2 additions & 3 deletions test/test-utils/call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ export class MockedCall extends Call {
url: "https://example.org",
name: "Group call",
creatorUserId: "@alice:example.org",
// waitForIframeLoad = false, makes the widget API wait for the 'contentLoaded' event instead.
// This is how the EC is designed, but for backwards compatibility (full mesh) we currently need to use waitForIframeLoad = true
// waitForIframeLoad: false
// waitForIframeLoad = false, makes the widget API wait for the 'contentLoaded' event.
waitForIframeLoad: false,
},
room.client,
);
Expand Down
Loading