fix(#289): fix switch playlist for hls matches

pull/87/head
Andrei Dekterev 3 years ago
parent 749491521a
commit cd9c35b301
  1. 3
      .eslintrc
  2. 4
      src/features/MatchPage/store/hooks/useMatchPlaylists.tsx

@ -93,6 +93,7 @@
"react/prop-types": "off",
"react/react-in-jsx-scope": "off",
"react/require-default-props": "off",
"semi": "off"
"semi": "off",
"no-multiple-empty-lines":["error",{ "max":1 }]
}
}

@ -14,7 +14,7 @@ import { getMatchPlaylists } from 'requests/getMatchPlaylists'
import { usePageParams } from 'hooks/usePageParams'
import type { Playlists } from 'features/MatchPage/types'
import { buildPlaylists } from 'features/MatchPage/helpers/buildPlaylists'
import { buildPlaylists, FULL_GAME_KEY } from 'features/MatchPage/helpers/buildPlaylists'
import { usePlaylistLexics } from './usePlaylistLexics'
import { useSelectedPlaylist } from './useSelectedPlaylist'
@ -65,7 +65,9 @@ export const useMatchPlaylists = (profile: MatchInfo) => {
}, [fetchLexics, setInitialSeletedPlaylist])
useEffect(() => {
if (selectedPlaylist?.id !== FULL_GAME_KEY) return
setSelectedPlaylist(matchPlaylists?.match[0])
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [
matchPlaylists?.match,
profileId,

Loading…
Cancel
Save