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) => {
38
38
getListenToArticleClient ( ) . isPlaying ( articleId ) ,
39
39
getListenToArticleClient ( ) . getAudioDurationSeconds ( articleId ) ,
40
40
] )
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 ) ;
50
49
} )
51
50
. catch ( ( error ) => {
52
51
console . error (
You can’t perform that action at this time.
0 commit comments