File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -11,11 +11,12 @@ import Chessground from '@react-chess/chessground'
1111import  {  Chess  }  from  'chess.ts' 
1212import  { 
1313  Opening , 
14+   EndgameTrait , 
1415  OpeningVariation , 
1516  OpeningSelection , 
1617  DrillConfiguration , 
17-   EndgameTrait , 
1818  DrillCategoryType , 
19+   EndgamePositionDetail , 
1920}  from  'src/types' 
2021import  {  ModalContainer  }  from  '../Common/ModalContainer' 
2122import  {  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' 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments