🐛 fix undefined bugs

This commit is contained in:
Nate Sesti 2023-12-08 19:49:02 -08:00
parent 158b20ce72
commit 4ce9df38c1
2 changed files with 4 additions and 2 deletions

View file

@ -27,7 +27,7 @@ function useContextProviders() {
>([]);
const providerConfig = useSelector(
(store: RootStore) => store.state.config.contextProviders
(store: RootStore) => store.state.config.contextProviders || []
);
useEffect(() => {

View file

@ -51,7 +51,9 @@ function useModels() {
const [defaultModel, setDefaultModel] = useState<LLM>(
new FreeTrial({ uniqueId: "None", model: "gpt-3.5-turbo" })
);
const models = useSelector((store: RootStore) => store.state.config.models);
const models = useSelector(
(store: RootStore) => store.state.config?.models || []
);
const defaultTitle = useSelector(
(store: RootStore) => store.state.config.modelRoles.default
);