Skip to content

Commit bd67b43

Browse files
authored
enable l2a (#14316)
1 parent c49d7c2 commit bd67b43

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

dotcom-rendering/src/components/ListenToArticle.importable.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff 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(

0 commit comments

Comments
 (0)