mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-18 22:14:27 +00:00
* 🧭 perf: Warm Conversation Switches with Single-Navigation Focus Intent * 🧭 fix: Drop Warm Message Cache When Conversation Revalidation Fails * 🧭 fix: Defer Departing-Convo Refetch and Gate Resume on Revalidation * 🧭 fix: Gate Stale-Cache Sends During Revalidation and Honor disableFocus
18 lines
579 B
TypeScript
18 lines
579 B
TypeScript
let pendingChatFocus = false;
|
|
|
|
/**
|
|
* Transient cross-navigation focus intent for the chat composer. Carried
|
|
* outside `location.state` so consuming it needs no second state-clearing
|
|
* navigation, which doubled every router-context sweep per conversation
|
|
* switch; being transient, it also never re-fires from history entries on
|
|
* back/forward navigation.
|
|
*/
|
|
export const requestChatFocus = (): void => {
|
|
pendingChatFocus = true;
|
|
};
|
|
|
|
export const consumeChatFocus = (): boolean => {
|
|
const requested = pendingChatFocus;
|
|
pendingChatFocus = false;
|
|
return requested;
|
|
};
|