mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-07 23:18:21 +00:00
Fix possible infinite loop on widget start (#7071)
* fix 15494 infinit loop on widget start error * change message to error from log and fix block style
This commit is contained in:
@@ -227,7 +227,7 @@ export default class AppTile extends React.Component<IProps, IState> {
|
|||||||
this.sgWidget.on("ready", this.onWidgetReady);
|
this.sgWidget.on("ready", this.onWidgetReady);
|
||||||
this.startWidget();
|
this.startWidget();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.log("Failed to construct widget", e);
|
logger.error("Failed to construct widget", e);
|
||||||
this.sgWidget = null;
|
this.sgWidget = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -241,7 +241,13 @@ export default class AppTile extends React.Component<IProps, IState> {
|
|||||||
private iframeRefChange = (ref: HTMLIFrameElement): void => {
|
private iframeRefChange = (ref: HTMLIFrameElement): void => {
|
||||||
this.iframe = ref;
|
this.iframe = ref;
|
||||||
if (ref) {
|
if (ref) {
|
||||||
if (this.sgWidget) this.sgWidget.start(ref);
|
try {
|
||||||
|
if (this.sgWidget) {
|
||||||
|
this.sgWidget.start(ref);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
logger.error("Failed to start widget", e);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.resetWidget(this.props);
|
this.resetWidget(this.props);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user