Only apply certain keyboard shortcuts in situations

This commit is contained in:
Josh Perez 2023-05-25 12:15:16 -04:00 committed by GitHub
parent 1941a33556
commit 35c3349fe6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 79 additions and 4 deletions

View file

@ -0,0 +1,16 @@
// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { createSelector } from 'reselect';
import type { StateType } from '../reducer';
import type { GlobalModalsStateType } from '../ducks/globalModals';
export const getGlobalModalsState = (state: StateType): GlobalModalsStateType =>
state.globalModals;
export const isShowingAnyModal = createSelector(
getGlobalModalsState,
(globalModalsState): boolean =>
Object.values(globalModalsState).some(value => Boolean(value))
);