Skip to content

Commit

Permalink
Add default for optional additional_segments parameter in video con…
Browse files Browse the repository at this point in the history
…sent (#89)

* fix undefined default for optional additional_segments param, and move text property into nested param object

* fix formatting

* add changeset
  • Loading branch information
becky-gilbert authored Oct 29, 2024
1 parent de38876 commit 7230f51
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .changeset/smart-books-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@lookit/record": patch
---

Add missing default value for video consent "additional_segments" parameter,
which was causing an error when this optional parameter was omitted (#84).
9 changes: 5 additions & 4 deletions packages/record/src/consentVideo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,16 @@ const info = <const>{
additional_segments: {
type: ParameterType.COMPLEX,
array: true,
default: [],
nested: {
title: {
type: ParameterType.STRING,
default: "",
},
},
text: {
type: ParameterType.STRING,
default: "",
text: {
type: ParameterType.STRING,
default: "",
},
},
},
prompt_all_adults: { type: ParameterType.BOOL, default: false },
Expand Down

0 comments on commit 7230f51

Please sign in to comment.