Skip to content

Commit

Permalink
fix errors when models is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
GregoMac1 committed Oct 9, 2024
1 parent e19d251 commit 8bc70ab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/components/FieldSelectModel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
let lastUsedModels: ModelOption[] = [];
let otherModels: ModelOption[] = [];
$: disabled = !$settingsStore.models.length;
$: models = $settingsStore.models.map((m) => ({
$: disabled = !$settingsStore.models?.length;
$: models = $settingsStore.models?.map((m) => ({
value: m.name,
label: m.name,
badge: [m.details.parameter_size, m.api]
Expand All @@ -30,7 +30,7 @@
label: m.name,
badge: [m.details.parameter_size, m.api]
}));
$: otherModels = models.filter((m) => !lastUsedModels.some((lm) => lm.value === m.value));
$: otherModels = models?.filter((m) => !lastUsedModels.some((lm) => lm.value === m.value)) || [];
</script>

<FieldSelect
Expand Down

0 comments on commit 8bc70ab

Please sign in to comment.