Skip to content

Commit ae9dd5a

Browse files
committed
attempt to fix params when selecting a image model
1 parent a94f216 commit ae9dd5a

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

src/lib/components/image/image-generation-modal.svelte

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,11 @@
9292
return normalized;
9393
});
9494
95+
let paramsReady = $state(false);
96+
9597
// Initialize default params when model changes
9698
$effect(() => {
99+
paramsReady = false;
97100
if (currentModel) {
98101
const defaults: Record<string, any> = {};
99102
@@ -180,7 +183,10 @@
180183
181184
// Update parent bindable
182185
Object.assign(imageParams, newParams);
186+
paramsReady = true;
183187
});
188+
} else {
189+
paramsReady = true;
184190
}
185191
});
186192
</script>
@@ -204,6 +210,9 @@
204210
Please select an image model in the chat to configure settings.
205211
</div>
206212
{:else}
213+
{#if !paramsReady}
214+
<div class="text-muted-foreground p-4 text-center text-sm">Loading settings...</div>
215+
{:else}
207216
<!-- Resolution selector -->
208217
{#if currentModel.resolutions && currentModel.resolutions.length > 0}
209218
<div class="flex flex-col gap-2">
@@ -300,6 +309,7 @@
300309
No configurable settings for this model.
301310
</div>
302311
{/if}
312+
{/if}
303313
{/if}
304314

305315
<div class="flex justify-end pt-4">

src/lib/components/video/video-generation-modal.svelte

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,11 @@
9292
return normalized;
9393
});
9494
95+
let paramsReady = $state(false);
96+
9597
// Initialize default params when model changes
9698
$effect(() => {
99+
paramsReady = false;
97100
if (currentModel) {
98101
const defaults: Record<string, any> = {};
99102
@@ -145,7 +148,10 @@
145148
}
146149
// Update parent bindable
147150
Object.assign(videoParams, newParams);
151+
paramsReady = true;
148152
});
153+
} else {
154+
paramsReady = true;
149155
}
150156
});
151157
</script>
@@ -168,6 +174,8 @@
168174
<div class="text-muted-foreground p-4 text-center text-sm">
169175
Please select a video capable model in the chat to configure settings.
170176
</div>
177+
{:else if !paramsReady}
178+
<div class="text-muted-foreground p-4 text-center text-sm">Loading settings...</div>
171179
{:else if normalizedParams.length > 0}
172180
{#each normalizedParams as param}
173181
<div class="flex flex-col gap-2">

0 commit comments

Comments
 (0)