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

Update widget tile if the url should change #12381

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/components/views/elements/AppTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ export default class AppTile extends React.Component<IProps, IState> {
!newProps.userWidget,
newProps.onDeleteClick,
),
widgetUrl: this.sgWidget?.embedUrl,
// Explicitly do not set until startWidget() has run
widgetUrl: undefined,
};
}

Expand Down Expand Up @@ -391,10 +392,11 @@ export default class AppTile extends React.Component<IProps, IState> {
}

private startWidget(): void {
this.sgWidget?.prepare().then(() => {
const widget = this.sgWidget;
widget?.prepare().then(() => {
if (this.unmounted) return;
if (!this.state.initialising) return;
this.setState({ initialising: false });
this.setState({ initialising: false, widgetUrl: widget.embedUrl });
});
}

Expand Down