From a697b39c48cca4565adacd99697822fa2db898a2 Mon Sep 17 00:00:00 2001 From: Hailey Date: Wed, 28 Feb 2024 11:46:19 -0800 Subject: [PATCH] add alf dialogs to useCloseAllActiveElements (#3021) --- src/state/util.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/state/util.ts b/src/state/util.ts index 57f4331b..7b49b5b4 100644 --- a/src/state/util.ts +++ b/src/state/util.ts @@ -3,6 +3,7 @@ import {useLightboxControls} from './lightbox' import {useModalControls} from './modals' import {useComposerControls} from './shell/composer' import {useSetDrawerOpen} from './shell/drawer-open' +import {useDialogStateControlContext} from 'state/dialogs' /** * returns true if something was closed @@ -35,11 +36,19 @@ export function useCloseAllActiveElements() { const {closeLightbox} = useLightboxControls() const {closeAllModals} = useModalControls() const {closeComposer} = useComposerControls() + const {closeAllDialogs: closeAlfDialogs} = useDialogStateControlContext() const setDrawerOpen = useSetDrawerOpen() return useCallback(() => { closeLightbox() closeAllModals() closeComposer() + closeAlfDialogs() setDrawerOpen(false) - }, [closeLightbox, closeAllModals, closeComposer, setDrawerOpen]) + }, [ + closeLightbox, + closeAllModals, + closeComposer, + closeAlfDialogs, + setDrawerOpen, + ]) }