File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
dotcom-rendering/src/components Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -38,15 +38,14 @@ export const ListenToArticle = ({ articleId }: Props) => {
3838 getListenToArticleClient ( ) . isPlaying ( articleId ) ,
3939 getListenToArticleClient ( ) . getAudioDurationSeconds ( articleId ) ,
4040 ] )
41- . then ( ( ) => {
42- // TODO pending design implementation and AB test set up.
43- // .then(({ isAvailable, isPlaying, audioDurationSeconds }) => {
44- // setAudioDuration(
45- // audioDurationSeconds ? audioDurationSeconds : undefined,
46- // );
47- // setShowButton(isAvailable && !isPlaying);
48- setAudioDurationSeconds ( undefined ) ;
49- setShowButton ( false ) ;
41+ . then ( ( [ isAvailable , isPlaying , durationSeconds ] ) => {
42+ setAudioDurationSeconds (
43+ typeof durationSeconds === 'number' &&
44+ durationSeconds > 0
45+ ? durationSeconds
46+ : undefined ,
47+ ) ;
48+ setShowButton ( isAvailable && ! isPlaying ) ;
5049 } )
5150 . catch ( ( error ) => {
5251 console . error (
You can’t perform that action at this time.
0 commit comments