Skip to content

Commit

Permalink
[Assistants] Fix selected model reactivity (huggingface#784)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mishig authored Feb 5, 2024
1 parent f3c82b6 commit 2128ce0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/routes/assistants/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const load = async ({ url }) => {

return {
assistants: JSON.parse(JSON.stringify(assistants)) as Array<Assistant>,
selectedModel: modelId ?? "",
numTotalItems,
numItemsPerPage: NUM_PER_PAGE,
};
Expand Down
4 changes: 1 addition & 3 deletions src/routes/assistants/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
export let data: PageData;
let selectedModel = $page.url.searchParams.get("modelId") ?? "";
const onModelChange = (e: Event) => {
const newUrl = new URL($page.url);
newUrl.search = ""; // clear searchParams (such as "p" for pagination)
Expand Down Expand Up @@ -65,7 +63,7 @@
<div class="mt-6 flex justify-between gap-2 max-sm:flex-col sm:items-center">
<select
class="mt-1 h-[34px] rounded-lg border border-gray-300 bg-gray-50 px-2 text-sm text-gray-900 focus:border-blue-700 focus:ring-blue-700 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400"
bind:value={selectedModel}
bind:value={data.selectedModel}
on:change={onModelChange}
>
<option value="">All models</option>
Expand Down

0 comments on commit 2128ce0

Please sign in to comment.