From ae8e32d8098b6f0aabc463843e210c75bff79c71 Mon Sep 17 00:00:00 2001 From: Hampus Date: Wed, 19 Aug 2026 12:41:19 +0200 Subject: [PATCH] fix(app): render modals above a fullscreen voice call (#1740) --- .../src/features/ui/commands/ModalCommands.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/fluxer_app/src/features/ui/commands/ModalCommands.ts b/fluxer_app/src/features/ui/commands/ModalCommands.ts index 9e70e1ad8..4e0807a46 100644 --- a/fluxer_app/src/features/ui/commands/ModalCommands.ts +++ b/fluxer_app/src/features/ui/commands/ModalCommands.ts @@ -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;