feat: check the server on launch and remember the selected model
The chat showed 'Server offline' until the user opened Settings, and the selected model was forgotten on every restart. useAutoConnect fetches the models once after the persisted settings are restored; activeModelId is now persisted.
This commit is contained in:
1 parent
1a3ce9ccec
commit
541aefd7e4
5 files changed
+72
-2
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { ModelSelector } from '@/components/chat/ModelSelector';
|
||||
import { useAutoConnect } from '@/hooks/useAutoConnect';
|
||||
import { useThemeColor } from '@/hooks/useThemeColor';
|
||||
import { useAppStore } from '@/store/useAppStore';
|
||||
import { Stack, useRouter } from 'expo-router';
|
||||
@@ -10,6 +11,7 @@ export default function ChatLayout() {
|
||||
const router = useRouter();
|
||||
const clearChat = useAppStore(state => state.clearChat);
|
||||
const colors = useThemeColor();
|
||||
useAutoConnect();
|
||||
|
||||
const isLargeScreen = width > 768;
|
||||
const containerStyle = [
|
||||
|
||||
Reference in new issue
Block a user