Skip to content

Conversation

@huyenltnguyen
Copy link
Member

Description

This PR does some refactoring and most importantly, fixes #76 by correcting this line:

const availableStreams = sortedStreams.filter(stream => stream.url !== url);

availableStreams above is assigned to the list of all streams, excluding the current one. This is not correct, however, as available streams should be all the streams we have, excluding current one and the ones in the errored list.

Result

The app stops when it has tried all streams, and none is available.

code-radio-fixed

@ahmaxed
Copy link
Member

ahmaxed commented Jun 20, 2020

Thanks for looking into this @huyenltnguyen.

@ahmaxed ahmaxed merged commit ddf4eb4 into freeCodeCamp:master Jun 20, 2020
@ahmaxed
Copy link
Member

ahmaxed commented Jun 20, 2020

Thanks for looking into this. @huyenltnguyen

@huyenltnguyen
Copy link
Member Author

Glad I can help 😄

@huyenltnguyen huyenltnguyen deleted the fix/infinite-loop branch June 21, 2020 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The app is stuck in an infinite loop when audio streams are unavailable

2 participants