Changeset 433e0c5 for components/poker
- Timestamp:
- 07/15/22 14:45:30 (3 years ago)
- Branches:
- main
- Children:
- 55701f0
- Parents:
- 1df3fde
- Location:
- components/poker
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
components/poker/Poker.jsx
r1df3fde r433e0c5 8 8 import Notification from '../Notification' 9 9 import PokerSections from './PokerSections' 10 import LostConnection from '../LostConnection' 10 11 11 12 const Poker = () => { … … 25 26 26 27 <Notification/> 28 29 <LostConnection/> 27 30 </div> 28 31 ) -
components/poker/PokerHeader.jsx
r1df3fde r433e0c5 10 10 import { useDispatch, useSelector } from 'react-redux' 11 11 12 import { setPlayer, setPokerGame , setSocket} from '../../redux/reducers/playerSlice'12 import { setPlayer, setPokerGame } from '../../redux/reducers/playerSlice' 13 13 import { setStyle } from '../../redux/reducers/styleSlice' 14 14 … … 36 36 if (interval !== null) clearInterval(interval); 37 37 38 dispatch(setPlayer({39 ...playerState.player,40 displayName: res.data?.displayName,41 session_id: res.data?.session_id,42 credits: res.data?.credits,43 }));44 45 dispatch(setStyle({46 ...styleState.style,47 displayLoadingScreen: false,48 }))49 50 38 interval = setInterval(() => { 51 39 axios.get(`/api/poker?action=update_state&session_id=${localStorage.CAESSINO_SESSION_ID}`).then(newRes => { … … 56 44 dispatch(setPlayer({ 57 45 ...playerState.player, 46 displayName: res.data?.displayName, 47 session_id: res.data?.session_id, 58 48 credits: newRes.data?.pokerGame?.player?.credits, 59 49 })) 60 50 } 61 51 } 52 53 dispatch(setStyle({ 54 ...styleState.style, 55 displayLoadingScreen: false, 56 notification: { 57 ...styleState.style.notification, 58 show: false, 59 }, 60 lostConnectionInfo: { 61 show: false, 62 message: '' 63 } 64 })) 65 }).catch(error => { 66 dispatch(setStyle({ 67 ...styleState.style, 68 displayLoadingScreen: false, 69 lostConnectionInfo: { 70 show: true, 71 message: 'Game will be played until the end upon server gets live. You cannot continue your game, but the money earned / lost will be updated.' 72 } 73 })) 62 74 }); 63 }, 2000);75 }, 1000); 64 76 } 65 77 else { -
components/poker/PokerSections.jsx
r1df3fde r433e0c5 1 1 import React from 'react' 2 2 3 import Cards from './sections/Cards'4 3 import CardsInTheMiddle from './sections/CardsInTheMiddle' 5 4 import Chairs from './sections/Chairs' … … 8 7 import PickATable from './sections/PickATable' 9 8 10 import { useSelector , useDispatch} from 'react-redux'9 import { useSelector } from 'react-redux' 11 10 import Pot from './sections/Pot' 12 11 import RaiseModal from './sections/RaiseModal' … … 21 20 22 21 <Chairs/> 23 24 <Cards/>25 22 26 23 <CardsInTheMiddle/> -
components/poker/sections/PickATable.jsx
r1df3fde r433e0c5 6 6 7 7 import axios from 'axios'; 8 import { setPokerGame } from '../../../redux/reducers/playerSlice';9 8 10 9 const PickATable = () => {
Note:
See TracChangeset
for help on using the changeset viewer.