diff --git a/client/src/components/chat.jsx b/client/src/components/chat.jsx
index f5f0a826..323d55c6 100644
--- a/client/src/components/chat.jsx
+++ b/client/src/components/chat.jsx
@@ -10,6 +10,7 @@ const addState = connect(
chatShow,
chatWheel,
instance,
+ game,
} = state;
function sendInstanceChat(instance, i) {
@@ -18,6 +19,7 @@ const addState = connect(
return {
instance,
+ game,
chatShow,
chatWheel,
@@ -39,6 +41,7 @@ const addState = connect(
function Chat(args) {
const {
instance,
+ game,
chatShow,
chatWheel,
@@ -47,7 +50,7 @@ function Chat(args) {
} = args;
function onClick(i) {
- sendInstanceChat(instance.id, i);
+ sendInstanceChat(instance ? instance.id : game && game.id, i);
setChatShow(false);
return true;
}
diff --git a/client/src/components/game.ctrl.btns.jsx b/client/src/components/game.ctrl.btns.jsx
index bac13a4b..671e9d62 100644
--- a/client/src/components/game.ctrl.btns.jsx
+++ b/client/src/components/game.ctrl.btns.jsx
@@ -8,6 +8,8 @@ const addState = connect(
const {
ws,
game,
+ account,
+ chatShow,
animating,
} = state;
@@ -30,6 +32,8 @@ const addState = connect(
return {
game,
+ account,
+ chatShow,
sendAbandon,
sendGameSkillClear,
sendReady,
@@ -60,6 +64,8 @@ function GameCtrlBtns(args) {
const {
game,
animating,
+ account,
+ chatShow,
getInstanceState,
sendGameSkillClear,
diff --git a/client/src/components/game.ctrl.jsx b/client/src/components/game.ctrl.jsx
index f4f778e1..4d7de121 100644
--- a/client/src/components/game.ctrl.jsx
+++ b/client/src/components/game.ctrl.jsx
@@ -4,6 +4,7 @@ const { connect } = require('preact-redux');
const actions = require('../actions');
const PlayerBox = require('./player.box');
+const Chat = require('./chat');
const GameCtrlButtons = require('./game.ctrl.btns');
const GameCtrlTopButtons = require('./game.ctrl.btns.top');
@@ -13,12 +14,16 @@ const addState = connect(
animating,
game,
account,
+ chatShow,
+ instanceChat,
} = state;
return {
animating,
game,
account,
+ chatShow,
+ instanceChat,
};
},
);
@@ -28,6 +33,8 @@ function Controls(args) {
animating,
account,
game,
+ chatShow,
+ instanceChat,
} = args;
if (!game) return false;
@@ -37,7 +44,7 @@ function Controls(args) {
const zero = Date.parse(game.phase_start);
const now = animating ? zero : Date.now();
const end = Date.parse(game.phase_end);
-
+
const timerPct = game.phase_end
? ((now - zero) / (end - zero) * 100)
: 100;
@@ -61,13 +68,17 @@ function Controls(args) {
);
+ const bottom = chatShow
+ ?
+ : ;
+
return (