Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (isIframeModal(transformedProps)) {
(this.appBridgeModal as AppBridgeModal.ModalIframe).set(
transformedProps,
);
} else {
(this.appBridgeModal as AppBridgeModal.ModalMessage).set(
transformedProps,
);
}
}
if (wasOpen !== open) {
if (open) {
this.appBridgeModal.dispatch(AppBridgeModal.Action.OPEN);
} else {
this.appBridgeModal.dispatch(AppBridgeModal.Action.CLOSE);
}
}
if (!wasOpen && open) {
this.focusReturnPointNode = document.activeElement as HTMLElement;
} else if (
wasOpen &&
!open &&
this.focusReturnPointNode != null &&
document.contains(this.focusReturnPointNode)
) {
this.focusReturnPointNode.focus();
this.focusReturnPointNode = null as any;
}
}