Skip to content

Commit

Permalink
Dev (#200)
Browse files Browse the repository at this point in the history
* 1. lift up z-index of toast.
2. change default toast duration to 2s.
3. add mic permission failed toast hint when push record btn.

Signed-off-by Shaochang Tan <478710209@qq.com>

* Fix leave ingame room (#199)

* fix runtime type warnings

* prevent push leave btn when you are ready
  • Loading branch information
petertheprocess authored May 20, 2024
1 parent d52e528 commit 42f22e5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
33 changes: 25 additions & 8 deletions src/components/views/Gameroom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ const Gameroom = () => {
playerStatus: PropTypes.arrayOf(
PropTypes.shape({
user: PropTypes.shape({
id: PropTypes.number.isRequired,
id: PropTypes.string.isRequired,
name: PropTypes.string.isRequired,
avatar: PropTypes.string.isRequired,
}).isRequired,
Expand Down Expand Up @@ -766,8 +766,9 @@ const Gameroom = () => {
<Header
onChange={
e => {
setGlobalVolume(e.target.value);
console.log("[volume] set to", e.target.value);
const volume = parseFloat(e.target.value);
setGlobalVolume(volume);
console.log("[volume] set to", volume);
}
}
onClickMute={
Expand Down Expand Up @@ -837,12 +838,28 @@ const Gameroom = () => {
Confirm
</div>
)}
<div className="gameroom leavebutton" onClick={
() => {
//console.log("leave room");
exitRoom();
<div className="gameroom leavebutton"
onClick={() =>
{
if (readyStatus.current === false){
throttledExitRoom();
} else {
showToast("Please cancel ready before leaving the room.", "error");
}
}
}
}>leave</div>
onKeyDown={() =>
{
if (readyStatus.current === false){
throttledExitRoom();
} else {
showToast("Please cancel ready before leaving the room.", "error");
}
}
}
>
leave
</div>
</>
)}
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/getDomain.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ 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 prodUrl = "https://sopra-fs24-group-09-server.oa.r.appspot.com/"
// 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"
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"
// const devUrl = "https://sopra-fs24-shatan-server.oa.r.appspot.com/" // TODO: insert your prod url for server (once deployed)

return isProduction() ? prodUrl : devUrl
Expand Down

0 comments on commit 42f22e5

Please sign in to comment.