mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
🔄 fix: update navigation logic in useFocusChatEffect to ensure correct search parameters are used (#7340)
This commit is contained in:
parent
f2f285ca1e
commit
502617db24
2 changed files with 404 additions and 2 deletions
|
|
@ -11,11 +11,16 @@ export default function useFocusChatEffect(textAreaRef: React.RefObject<HTMLText
|
|||
'conversation',
|
||||
`Focusing textarea on location state change: ${location.pathname}`,
|
||||
);
|
||||
|
||||
/** Check if the device is not a touchscreen */
|
||||
if (!window.matchMedia?.('(pointer: coarse)').matches) {
|
||||
textAreaRef.current?.focus();
|
||||
}
|
||||
navigate(`${location.pathname}${location.search ?? ''}`, { replace: true, state: {} });
|
||||
|
||||
navigate(`${location.pathname}${window.location.search ?? ''}`, {
|
||||
replace: true,
|
||||
state: {},
|
||||
});
|
||||
}
|
||||
}, [navigate, textAreaRef, location.pathname, location.state?.focusChat, location.search]);
|
||||
}, [navigate, textAreaRef, location.pathname, location.state?.focusChat]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue