fix(app): render modals above a fullscreen voice call (#1740)

This commit is contained in:
Hampus authored and GitHub committed 2026-08-19 12:41:19 +02:00
1 parent a81b1abec7
commit ae8e32d809
1 file changed
+10 -5
@@ -21,11 +21,16 @@ const isBackgroundModal = (element: React.ReactElement): boolean => {
return BACKGROUND_MODAL_TYPES.some((type) => element.type === type);
};
const getCommandOwnerDocument = (): Document => getActivePortalHost()?.ownerDocument ?? document;
const getPushOptions = (isBackground: boolean) => ({
isBackground,
forceMainWindow: isBackground,
portalHost: isBackground ? null : getActivePortalHost(),
});
const getPushOptions = (isBackground: boolean) => {
const activePortalHost = getActivePortalHost();
const isPoppedOut = activePortalHost?.ownerDocument !== document;
const forceMainWindow = isBackground && isPoppedOut;
return {
isBackground,
forceMainWindow,
portalHost: forceMainWindow ? null : activePortalHost,
};
};
export function modal(render: () => React.ReactElement): ModalRender {
return render as ModalRender;