Skip to content

Commit

Permalink
fix: showUpload from integration bool checking and fallbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
nzambello committed Dec 24, 2024
1 parent 89506e7 commit c87f5d8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions src/components/MemoriWidget/MemoriWidget.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,27 @@ ShowClear.args = {
showClear: true,
};

export const ShowUpload = Template.bind({});
ShowUpload.args = {
memori,
tenant,
showUpload: true,
};

export const ShowUploadFromIntegration = Template.bind({});
ShowUploadFromIntegration.args = {
memori,
tenant,
showUpload: false,
integration: {
...integration,
customData: JSON.stringify({
...JSON.parse(integration.customData ?? '{}'),
showUpload: true,
}),
},
};

export const WithoutAudio = Template.bind({});
WithoutAudio.args = {
memori,
Expand Down
2 changes: 1 addition & 1 deletion src/components/MemoriWidget/MemoriWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2555,7 +2555,7 @@ const MemoriWidget = ({
? true
: integrationConfig?.showAIicon;

const enableUpload = showUpload ?? integrationConfig?.showUpload ?? false;
const enableUpload = showUpload || !!integrationConfig?.showUpload;

const showWhyThisAnswer =
integrationConfig?.showWhyThisAnswer === undefined
Expand Down

0 comments on commit c87f5d8

Please sign in to comment.