@@ -12,7 +12,6 @@ import { Tournament } from 'src/components'
1212import { FavoriteModal } from 'src/components/Common/FavoriteModal'
1313import { AnalysisListContext } from 'src/contexts'
1414import { fetchMaiaGameList } from 'src/api'
15- import { ensureMigration } from 'src/lib/customAnalysis'
1615import {
1716 getFavoritesAsWebGames ,
1817 addFavoriteGame ,
@@ -60,21 +59,13 @@ interface AnalysisGameListProps {
6059export const AnalysisGameList : React . FC < AnalysisGameListProps > = ( {
6160 currentId,
6261 loadNewTournamentGame,
63- loadNewLichessGames,
64- loadNewUserGames,
65- loadNewCustomGame,
6662 onCustomAnalysis,
6763 onGameSelected,
6864 refreshTrigger,
6965} ) => {
7066 const router = useRouter ( )
71- const {
72- analysisPlayList,
73- analysisHandList,
74- analysisBrainList,
75- analysisLichessList,
76- analysisTournamentList,
77- } = useContext ( AnalysisListContext )
67+ const { analysisLichessList, analysisTournamentList } =
68+ useContext ( AnalysisListContext )
7869
7970 const [ currentPage , setCurrentPage ] = useState ( 1 )
8071 const [ totalPages , setTotalPages ] = useState ( 1 )
@@ -96,14 +87,12 @@ export const AnalysisGameList: React.FC<AnalysisGameListProps> = ({
9687 )
9788 const [ hbSubsection , setHbSubsection ] = useState < 'hand' | 'brain' > ( 'hand' )
9889
99- // Modal state for favoriting
10090 const [ favoriteModal , setFavoriteModal ] = useState < {
10191 isOpen : boolean
10292 game : MaiaGameListEntry | null
10393 } > ( { isOpen : false , game : null } )
10494
10595 useEffect ( ( ) => {
106- // Load favorites asynchronously
10796 getFavoritesAsWebGames ( )
10897 . then ( ( favorites ) => {
10998 setFavoriteGames ( favorites )
@@ -115,12 +104,6 @@ export const AnalysisGameList: React.FC<AnalysisGameListProps> = ({
115104 } )
116105 } , [ refreshTrigger ] )
117106
118- useEffect ( ( ) => {
119- ensureMigration ( ) . catch ( ( error ) => {
120- console . warn ( 'Failed to migrate custom analyses:' , error )
121- } )
122- } , [ ] )
123-
124107 useEffect ( ( ) => {
125108 if ( currentId ?. [ 1 ] === 'custom' ) {
126109 setSelected ( 'custom' )
@@ -752,10 +735,7 @@ export const AnalysisGameList: React.FC<AnalysisGameListProps> = ({
752735 setLoadingIndex ( index )
753736 if ( game . type === 'pgn' ) {
754737 router . push ( `/analysis/${ game . id } /pgn` )
755- } else if (
756- game . type === 'custom-pgn' ||
757- game . type === 'custom-fen'
758- ) {
738+ } else if ( game . type === 'custom' ) {
759739 router . push ( `/analysis/${ game . id } /custom` )
760740 } else {
761741 router . push ( `/analysis/${ game . id } /${ game . type } ` )
0 commit comments