Skip to content

Commit

Permalink
fix: remove view_count filter for offline channels due to deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
alsolovyev committed May 25, 2024
1 parent 1c506fe commit 41d51ba
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/hooks/useFollowedStreams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import type { ITwitchError, ITwitchLiveStream, ITwitchUser } from '../services/t
* @returns an array of three elements: error, isLoading and an array of live stream.
*/
export default (
isOfflineHidden: boolean = false,
minViewCount: number = 1e4
isOfflineHidden: boolean = false
): [ITwitchError | IApiServiceError | undefined, boolean, Array<ITwitchLiveStream>, Array<ITwitchUser>] => {
const [error, setError] = useState<ITwitchError | IApiServiceError>()
const [isLoading, setIsLoading] = useState<boolean>(true)
Expand All @@ -38,11 +37,7 @@ export default (
offlineFollowedUsers.map(({ broadcaster_id }) => broadcaster_id)
)

const filteredOfflineStreams: Array<ITwitchUser> = offlineStreams.filter(
({ view_count }) => view_count > minViewCount
)

setOfflineStreams(filteredOfflineStreams)
setOfflineStreams(offlineStreams)
}

getStreams()
Expand Down

0 comments on commit 41d51ba

Please sign in to comment.