Feat/better hotkeys scope (#526)
* Working version * fix * Fixed console log * Fix lint * wip * Fix * Fix * consolelog --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
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 });
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user