fix: close portal if main window closes

This commit is contained in:
moT01
2023-01-04 08:46:34 -06:00
parent 5acda05505
commit 7e89c3431d
@@ -101,6 +101,11 @@ class PreviewPortal extends Component<PreviewPortalProps> {
});
this.props.storePortalWindow(this.externalWindow);
// close the portal if the main window closes
this.mainWindow?.addEventListener('beforeunload', () => {
this.externalWindow?.close();
});
}
componentWillUnmount() {