File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
src/components/Card/hooks Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -14,16 +14,16 @@ export function useCardPile() {
1414 const bust = useRef < boolean > ( false ) ;
1515 const fiveCardTrick = useRef < boolean > ( false ) ;
1616 const allCardsVisible = useRef < boolean > ( false ) ;
17- const { play} = useAudioPlayer ( ) ;
17+ const { play } = useAudioPlayer ( ) ;
1818
1919 /**
2020 * Add cards to the pile
2121 * @param cardsToAdd The cards to be added to the pile
2222 * @param facing The direction the card should be facing when placed in the pile
2323 */
2424 function addCards ( cardsToAdd : CardObject [ ] , facing : Facing | null = null ) {
25- cardsToAdd . forEach ( card => {
26- play ( ' cardDealt' ) ;
25+ cardsToAdd . forEach ( ( card ) => {
26+ play ( " cardDealt" ) ;
2727 if ( facing ) card . facing = facing ;
2828 } ) ;
2929 setCards ( [ ...cards ] . concat ( cardsToAdd ) ) ;
@@ -45,8 +45,9 @@ export function useCardPile() {
4545
4646 bestHand . current = calculateBestHand ( cardsToSet ) ;
4747 bust . current = bestHand . current . score > 21 ;
48- fiveCardTrick . current = cards . length === 5 && bestHand . current . score <= 21 ;
49-
48+ fiveCardTrick . current =
49+ cardsToSet . length === 5 && bestHand . current . score <= 21 ;
50+
5051 setCardsState ( cardsToSet ) ;
5152 }
5253
You can’t perform that action at this time.
0 commit comments