Skip to content

Commit 7b6d7e8

Browse files
committed
fix: file attachment group condition
1 parent 20a4e39 commit 7b6d7e8

File tree

1 file changed

+20
-23
lines changed

1 file changed

+20
-23
lines changed

package/src/components/Attachment/FileAttachmentGroup.tsx

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -115,29 +115,26 @@ const FileAttachmentGroupWithContext = <
115115
attachmentContainer,
116116
]}
117117
>
118-
{file.type === FileTypes.Audio || file.type === FileTypes.VoiceRecording ? (
119-
isSoundPackageAvailable() ? (
120-
<AudioAttachment
121-
item={{
122-
duration: file.duration,
123-
file: {
124-
name: file.title as string,
125-
uri: file.asset_url,
126-
waveform_data: file.waveform_data,
127-
},
128-
id: index.toString(),
129-
paused: file.paused,
130-
progress: file.progress,
131-
type: file.type,
132-
}}
133-
onLoad={onLoad}
134-
onPlayPause={onPlayPause}
135-
onProgress={onProgress}
136-
showSpeedSettings={true}
137-
/>
138-
) : (
139-
<Attachment attachment={file} />
140-
)
118+
{(file.type === FileTypes.Audio || file.type === FileTypes.VoiceRecording) &&
119+
isSoundPackageAvailable() ? (
120+
<AudioAttachment
121+
item={{
122+
duration: file.duration,
123+
file: {
124+
name: file.title as string,
125+
uri: file.asset_url,
126+
waveform_data: file.waveform_data,
127+
},
128+
id: index.toString(),
129+
paused: file.paused,
130+
progress: file.progress,
131+
type: file.type,
132+
}}
133+
onLoad={onLoad}
134+
onPlayPause={onPlayPause}
135+
onProgress={onProgress}
136+
showSpeedSettings={true}
137+
/>
141138
) : (
142139
<Attachment attachment={file} />
143140
)}

0 commit comments

Comments
 (0)