Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into lobby-feature-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
petertheprocess committed May 7, 2024
2 parents f413f22 + 5cf9e41 commit 8a14da0
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 86 deletions.
2 changes: 1 addition & 1 deletion src/components/ui/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const Button = props => (


Button.propTypes = {
width: PropTypes.number,
width: PropTypes.string,
style: PropTypes.object || PropTypes.string,
className: PropTypes.string,
children: PropTypes.node,
Expand Down
14 changes: 7 additions & 7 deletions src/components/views/Gameroom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import PropTypes from "prop-types";
import "styles/views/Gameroom.scss";
import "styles/views/Header.scss";
import "styles/twemoji-amazing.css";
import Header from "./Header";
import Header from "./Header"
import { FFmpeg } from "@ffmpeg/ffmpeg";
import { Roundstatus, RoundstatusProps} from "components/views/GameroomRoundStatus";
import { Roundstatus, RoundstatusProps } from "components/views/GameroomRoundStatus";
import { PlayerList } from "components/views/GameroomPlayerList";
import { ValidateAnswerForm } from "components/views/GameroomAnswerForm";
// Stomp related imports
Expand Down Expand Up @@ -158,8 +158,8 @@ const Gameroom = () => {
const onResponseReceived = (payload) => {
const payloadData = JSON.parse(payload.body);
console.error("Response received", payloadData.message);
alert("Response server side receive!"+payloadData.message)
navigate("/lobby");
// alert("Response server side receive!"+payloadData.message)
// navigate("/lobby");
// TODO: handle response
/// 1. filter the response by the receiptId
/// 2. if the response is success, do nothing
Expand All @@ -174,7 +174,7 @@ const Gameroom = () => {
const myInfo = payloadData.message.find(item => item.user.id === user.id);
//console.log("set info for myself")
//console.log(myInfo);
if (myInfo.roundFinished !== null){
if (myInfo && myInfo.roundFinished !== null){
roundFinished.current = myInfo.roundFinished;
//console.log("roundFinished?")
//console.log(roundFinished.current);
Expand All @@ -188,7 +188,7 @@ const Gameroom = () => {

const onGameInfoReceived = (payload) => {
const payloadData = JSON.parse(payload.body);
console.error("GameInfo received", JSON.stringify(payloadData.message));
// console.error("GameInfo received", JSON.stringify(payloadData.message));
if (JSON.stringify(gameInfoRef.current) === JSON.stringify(payloadData.message)) {
console.log("Same game info received, ignore");

Expand Down Expand Up @@ -593,7 +593,7 @@ const Gameroom = () => {
};


if (playerLists === null) {
if (playerLists === null || playerLists.length === 0) {
return <div>Loading...</div>;
}

Expand Down
Loading

0 comments on commit 8a14da0

Please sign in to comment.