66dcc9b2e1
* Working version * fix * Fixed console log * Fix lint * wip * Fix * Fix * consolelog --------- Co-authored-by: Charles Bochet <charles@twenty.com>
19 lines
563 B
TypeScript
19 lines
563 B
TypeScript
import { useResetRecoilState } from 'recoil';
|
|
|
|
import { hotkeysScopeStackState } from '../states/internal/hotkeysScopeStackState';
|
|
|
|
import { useAddToHotkeysScopeStack } from './useAddToHotkeysScopeStack';
|
|
|
|
export function useResetHotkeysScopeStack() {
|
|
const resetHotkeysScopeStack = useResetRecoilState(hotkeysScopeStackState);
|
|
const addHotkeysScopedStack = useAddToHotkeysScopeStack();
|
|
|
|
return function reset(toFirstScope?: string) {
|
|
resetHotkeysScopeStack();
|
|
|
|
if (toFirstScope) {
|
|
addHotkeysScopedStack({ scope: toFirstScope });
|
|
}
|
|
};
|
|
}
|