Skip to content

Commit

Permalink
Merge pull request #114 from sopra-fs24-group-09/M3-fast-fix
Browse files Browse the repository at this point in the history
M3 fast fix
  • Loading branch information
petertheprocess authored Apr 26, 2024
2 parents abb04af + 6dfb67a commit b54ea65
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
Learn how to configure a non-root public URL by running `npm run build` or
have a look at the documentation https://create-react-app.dev/docs/using-the-public-folder/.
-->
<title>SoPra FS24 - Group XX</title>
<title>SoPra FS24 - Group 09</title>
</head>

<body>
Expand Down
12 changes: 9 additions & 3 deletions src/components/ui/AudioRecorder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,15 @@ export const AudioRecorder = React.forwardRef((props,ref) => {
disabled = {props.disabled || !waveAvailable}
className="audio-recorder button-container playback-rate-dropdown"
onChange={(e) => {
const rate = parseFloat(e.target.value);
setPlaybackRate(rate);
wavesurfer.current?.setPlaybackRate(rate, true);
try {
// console.warn("e", e);
const rate = parseFloat(e);
setPlaybackRate(rate);
wavesurfer.current?.setPlaybackRate(rate, true);
}
catch (error) {
console.error("Failed to set playback rate", error);
}
}}
defaultValue={playbackRate}
options={[
Expand Down
1 change: 0 additions & 1 deletion src/components/views/Gameroom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,6 @@ const Gameroom = () => {
console.log(playerLists);

const LeaderBoard = ({ playerStatus }) => {
// console.log("123456")
console.log("[LeaderBoard]",playerStatus)
const sortedPlayerStatus = playerStatus.slice().sort((a, b) => b.score.total - a.score.total);
return (
Expand Down
10 changes: 5 additions & 5 deletions src/components/views/Lobby.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ const Lobby = () => {
async function enterRoom(roomId, userId) {
try {
const requestBody = JSON.stringify({ id: userId });
await api.put(`/games/${roomId}`, requestBody);
// await api.put(`/games/${roomId}`, requestBody);
} catch (error) {
handleError(error);

Expand Down Expand Up @@ -561,11 +561,11 @@ const Lobby = () => {
placeholder="2"
value={numRounds}
onChange={e => {
const value = parseInt(e.target.value, 10);
setNumRounds(value >= 2 && value <= 10 ? value : "");
const value = parseInt(e.target.value, 3);
setNumRounds(value >= 2 && value <= 3 ? value : "");
}}
min={2}
max={10}
max={3}
/>
<Dropdown
className="theme-dropdown"
Expand All @@ -580,7 +580,7 @@ const Lobby = () => {
onChange={(value) => setRoomTheme(value)}
/>
<div className="room-creation-popup btn-container">
<Button disabled={roomName === "" || numRounds < 2 || numRounds > 10 || roomTheme === ""}
<Button disabled={roomName === "" || numRounds < 2 || numRounds > 3 || roomTheme === ""}
className="create-room" onClick={createRoom}>Create Room</Button>
<Button className="cancel" onClick={toggleRoomCreationPop}>Cancel</Button>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/helpers/getDomain.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { isProduction } from "./isProduction"
*/
export const getDomain = () => {
const prodUrl = "https://sopra-fs24-group-09-server.oa.r.appspot.com/" // TODO: insert your prod url for server (once deployed)
// const devUrl = "https://sopra-fs24-group-09-server.oa.r.appspot.com/" // TODO: insert your prod url for server (once deployed)
const devUrl = "http://localhost:8080"

return isProduction() ? prodUrl : devUrl
Expand Down

0 comments on commit b54ea65

Please sign in to comment.