Skip to content

Commit

Permalink
Fix accordion auto opening
Browse files Browse the repository at this point in the history
  • Loading branch information
gtluszcz committed Sep 29, 2024
1 parent 8231677 commit 099c21c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/Declaration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ function DeclarationContent({ model, setModel }: { model: Model; setModel: Dispa
<div className="p-6 h-full overflow-y-auto">
<h2 className="text-2xl font-semibold text-gov-blue">Deklaracja PCC-3</h2>

<Accordion type="single" value={value ?? undefined} onValueChange={(value) => {
setValue(value ==='' ? null : value as keyof Model)
<Accordion type="single" value={value ?? ''} onValueChange={(value) => {
setValue(value === '' ? null : value as keyof Model)
}} collapsible className="mt-4">
<AccordionItem value="sekcja_a">
<AccordionTrigger className="text-left font-bold">A. Okres, miejsce i cel składania deklaracji</AccordionTrigger>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function Index() {
mutationFn: chat,
onSuccess(data) {
setMessages((messages) => [...messages, { role: 'assistant', content: data.text }])
setModel((model) => merge(model, data.model))
setModel((model) => ({...merge(model, data.model)}))
},
})

Expand Down

0 comments on commit 099c21c

Please sign in to comment.