Only apply certain keyboard shortcuts in situations
This commit is contained in:
parent
1941a33556
commit
35c3349fe6
2 changed files with 79 additions and 4 deletions
16
ts/state/selectors/globalModals.ts
Normal file
16
ts/state/selectors/globalModals.ts
Normal 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))
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue