pl-fe: fix handle hotkey new behavior

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2025-09-14 13:20:09 +02:00
parent 1834e39bf9
commit 4c475842ee

View File

@ -56,8 +56,10 @@ const GlobalHotkeys: React.FC<IGlobalHotkeys> = ({ children, node }) => {
if (element) {
((element as any).__lexicalEditor as LexicalEditor).dispatchCommand(FOCUS_EDITOR_COMMAND, undefined);
return element.getAttribute('data-compose-id');
} else {
openModal('COMPOSE');
return 'compose-modal';
}
};
@ -75,8 +77,8 @@ const GlobalHotkeys: React.FC<IGlobalHotkeys> = ({ children, node }) => {
};
const handleHotkeyForceNew = (e?: KeyboardEvent) => {
handleHotkeyNew(e);
dispatch(resetCompose());
const composeId = handleHotkeyNew(e);
dispatch(resetCompose(composeId || undefined));
};
const handleHotkeyBack = () => {