🌡️ feat: Periodic Health Check to prevent UI Inactivity Connection Errors (#3589)

* 🌡️ feat: Periodic Health Check to prevent UI Inactivity Connection Errors

* feat: Add refetchOnWindowFocus option for health check

* feat: programmatically scroll to end when a chat request is initiated (and messages have rendered)
This commit is contained in:
Danny Avila 2024-08-08 14:52:12 -04:00 committed by GitHub
parent cf393b1308
commit 6ea2628b56
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 81 additions and 14 deletions

View file

@ -43,3 +43,12 @@ export const getTextKey = (message?: TMessage | null, convoId?: string | null) =
Constants.COMMON_DIVIDER
}${message.conversationId ?? convoId}`;
};
export const scrollToEnd = () => {
setTimeout(() => {
const messagesEndElement = document.getElementById('messages-end');
if (messagesEndElement) {
messagesEndElement.scrollIntoView({ behavior: 'instant' });
}
}, 500);
};