mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
Cleanup App.jsx
This commit is contained in:
parent
7b7ba96786
commit
d24abf6a2a
1 changed files with 11 additions and 17 deletions
|
|
@ -59,24 +59,18 @@ const App = () => {
|
|||
window.location.href = '/auth/login';
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (searchEnabledQuery.error) {
|
||||
console.error("Failed to get search enabled", searchEnabledQuery.error);
|
||||
}
|
||||
if (searchEnabledQuery.data) {
|
||||
setIsSearchEnabled(searchEnabledQuery.data);
|
||||
} else if(searchEnabledQuery.isError) {
|
||||
console.error("Failed to get search enabled", searchEnabledQuery.error);
|
||||
}
|
||||
}, [searchEnabledQuery.data, setIsSearchEnabled, searchEnabledQuery.error]);
|
||||
|
||||
useEffect(() => {
|
||||
if (userQuery.error) {
|
||||
console.error("Failed to get user", userQuery.error);
|
||||
}
|
||||
if (userQuery.data) {
|
||||
setUser(userQuery.data);
|
||||
} else if(userQuery.isError) {
|
||||
console.error("Failed to get user", userQuery.error);
|
||||
window.location.href = '/auth/login';
|
||||
}
|
||||
}, [userQuery.data, setUser, userQuery.error]);
|
||||
|
||||
|
||||
if (user)
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue