Skip to content

Commit be0f626

Browse files
fix: build errors
1 parent f535553 commit be0f626

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/components/Openings/OpeningSelectionModal.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ import Chessground from '@react-chess/chessground'
1111
import { Chess } from 'chess.ts'
1212
import {
1313
Opening,
14+
EndgameTrait,
1415
OpeningVariation,
1516
OpeningSelection,
1617
DrillConfiguration,
17-
EndgameTrait,
1818
DrillCategoryType,
19+
EndgamePositionDetail,
1920
} from 'src/types'
2021
import { ModalContainer } from '../Common/ModalContainer'
2122
import { useTour } from 'src/contexts'
@@ -36,7 +37,6 @@ import {
3637
ENDGAME_TRAIT_LABELS,
3738
collectEndgamePositions,
3839
EndgameDataset,
39-
EndgamePositionDetail,
4040
EndgameCategoryData,
4141
EndgameMotifData,
4242
} from 'src/lib/endgames'
@@ -1309,8 +1309,17 @@ export const OpeningSelectionModal: React.FC<Props> = ({
13091309
const hasEndgames = normalizedEndgames.length > 0
13101310

13111311
const initialBrowseCategory: 'openings' | 'endgames' | 'custom' =
1312-
initialSelectionCategory ??
1313-
(hasOpenings ? 'openings' : hasEndgames ? 'endgames' : 'custom')
1312+
initialSelectionCategory === 'opening'
1313+
? 'openings'
1314+
: initialSelectionCategory === 'endgame'
1315+
? 'endgames'
1316+
: initialSelectionCategory === 'custom'
1317+
? 'custom'
1318+
: hasOpenings
1319+
? 'openings'
1320+
: hasEndgames
1321+
? 'endgames'
1322+
: 'custom'
13141323

13151324
const [browseCategory, setBrowseCategory] = useState<
13161325
'openings' | 'endgames' | 'custom'

0 commit comments

Comments
 (0)