Changeset 9bd09b0 for components/blackjack/PlayButtons.jsx
- Timestamp:
- 06/23/22 00:08:35 (2 years ago)
- Branches:
- main
- Children:
- ace7865
- Parents:
- 285c3cc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
components/blackjack/PlayButtons.jsx
r285c3cc r9bd09b0 4 4 import { AiFillCheckCircle } from 'react-icons/ai' 5 5 6 import { set Game, setPlayer } from '../../redux/reducers/playerSlice';6 import { setBlackjackGame, setPlayer } from '../../redux/reducers/playerSlice'; 7 7 import { setBlackjack, setStyle } from '../../redux/reducers/styleSlice'; 8 8 … … 46 46 axios.get(`/api/blackjack?action=make_initial_bet&session_id=${localStorage.CAESSINO_SESSION_ID}&bet=${styleState.blackjack.inputControls.initialBet.chosenCredits}`).then(res => { 47 47 if (res.data?.success) { 48 dispatch(set Game({49 ...playerState. game,48 dispatch(setBlackjackGame({ 49 ...playerState.blackjackGame, 50 50 status: res.data?.status, 51 51 })) … … 124 124 const texts = splitTexts(e.target.innerHTML); 125 125 126 dispatch(set Game({127 ...playerState. game,126 dispatch(setBlackjackGame({ 127 ...playerState.blackjackGame, 128 128 sideBetName: sideBetName 129 129 })) … … 145 145 146 146 function placeSideBetClicked() { 147 axios.get(`/api/blackjack?action=make_side_bet&session_id=${localStorage.CAESSINO_SESSION_ID}&bet=${styleState.blackjack.inputControls.sideBet.chosenCredits}&betName=${playerState. game.sideBetName}`).then(res => {148 if (res.data?.success) { 149 dispatch(set Game({150 ...playerState. game,147 axios.get(`/api/blackjack?action=make_side_bet&session_id=${localStorage.CAESSINO_SESSION_ID}&bet=${styleState.blackjack.inputControls.sideBet.chosenCredits}&betName=${playerState.blackjackGame.sideBetName}`).then(res => { 148 if (res.data?.success) { 149 dispatch(setBlackjackGame({ 150 ...playerState.blackjackGame, 151 151 status: res.data?.status, 152 152 })) … … 201 201 axios.get(`/api/blackjack?action=get_initial_cards&session_id=${localStorage.CAESSINO_SESSION_ID}`).then(res => { 202 202 if (res.data?.success) { 203 dispatch(set Game({204 ...playerState. game,203 dispatch(setBlackjackGame({ 204 ...playerState.blackjackGame, 205 205 status: res.data?.status, 206 206 playerCards: res.data?.playerCards, … … 210 210 if (res.data?.sideBetOutcome !== '') { 211 211 if (res.data.sideBetOutcome === 'side_bet_won') { 212 dispatch(set Game({213 ...playerState. game,212 dispatch(setBlackjackGame({ 213 ...playerState.blackjackGame, 214 214 credits: res.data?.credits, 215 215 })) … … 250 250 axios.get(`/api/blackjack?action=hit_a_card&session_id=${localStorage.CAESSINO_SESSION_ID}`).then(res => { 251 251 if (res.data?.success) { 252 dispatch(set Game({253 ...playerState. game,252 dispatch(setBlackjackGame({ 253 ...playerState.blackjackGame, 254 254 status: res.data?.status, 255 255 playerCards: res.data?.playerCards, … … 284 284 axios.get(`/api/blackjack?action=stand&session_id=${localStorage.CAESSINO_SESSION_ID}`).then(res => { 285 285 if (res.data?.success) { 286 dispatch(set Game({287 ...playerState. game,286 dispatch(setBlackjackGame({ 287 ...playerState.blackjackGame, 288 288 status: res.data?.status, 289 289 playerCards: res.data?.playerCards,
Note:
See TracChangeset
for help on using the changeset viewer.