mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-22 10:24:09 +01:00
Feat/startup config api (#518)
* feat: add api for config * feat: add data service to client * feat: update client pages with values from config endpoint * test: update tests * Update configurations and documentation to remove VITE_SHOW_GOOGLE_LOGIN_OPTION and change VITE_APP_TITLE to APP_TITLE * include APP_TITLE with startup config * Add test for new route * update backend-review pipeline * comment out test until we can figure out testing routes in CI * update: .env.example --------- Co-authored-by: fuegovic <32828263+fuegovic@users.noreply.github.com>
This commit is contained in:
parent
2da81db440
commit
3634d8691a
25 changed files with 419 additions and 75 deletions
|
|
@ -7,7 +7,11 @@ import Messages from '../components/Messages';
|
|||
import TextChat from '../components/Input';
|
||||
|
||||
import store from '~/store';
|
||||
import { useGetMessagesByConvoId, useGetConversationByIdMutation } from '~/data-provider';
|
||||
import {
|
||||
useGetMessagesByConvoId,
|
||||
useGetConversationByIdMutation,
|
||||
useGetStartupConfig
|
||||
} from '~/data-provider';
|
||||
|
||||
export default function Chat() {
|
||||
const searchQuery = useRecoilValue(store.searchQuery);
|
||||
|
|
@ -21,6 +25,7 @@ export default function Chat() {
|
|||
//disabled by default, we only enable it when messagesTree is null
|
||||
const messagesQuery = useGetMessagesByConvoId(conversationId, { enabled: false });
|
||||
const getConversationMutation = useGetConversationByIdMutation(conversationId);
|
||||
const { data: config } = useGetStartupConfig();
|
||||
|
||||
// when conversation changed or conversationId (in url) changed
|
||||
useEffect(() => {
|
||||
|
|
@ -53,8 +58,8 @@ export default function Chat() {
|
|||
// conversationId (in url) should always follow conversation?.conversationId, unless conversation is null
|
||||
navigate(`/chat/${conversation?.conversationId}`);
|
||||
}
|
||||
document.title = conversation?.title || import.meta.env.VITE_APP_TITLE || 'Chat';
|
||||
}, [conversation, conversationId]);
|
||||
document.title = conversation?.title || config?.appTitle || 'Chat';
|
||||
}, [conversation, conversationId, config]);
|
||||
|
||||
useEffect(() => {
|
||||
if (messagesTree === null && conversation?.conversationId) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue