1
0

Remove hack comment as the hack is not being referenced

Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
This commit is contained in:
James Ketrenos 2022-03-16 13:42:38 -07:00
parent e6ad81502f
commit 2137bdcf25

View File

@ -24,8 +24,6 @@ const
borderImageWidth = (2 + 2/3) * tileImageWidth, /* 2.667 * .Tile.width */ borderImageWidth = (2 + 2/3) * tileImageWidth, /* 2.667 * .Tile.width */
borderImageHeight = borderImageWidth * 0.29; /* 0.29 * .Border.height */ borderImageHeight = borderImageWidth * 0.29; /* 0.29 * .Border.height */
let hack = undefined;
const Board = () => { const Board = () => {
const { ws } = useContext(GlobalContext); const { ws } = useContext(GlobalContext);
const board = useRef(); const board = useRef();
@ -144,10 +142,6 @@ const Board = () => {
const refWsMessage = useRef(onWsMessage); const refWsMessage = useRef(onWsMessage);
useEffect(() => { refWsMessage.current = onWsMessage; }); useEffect(() => { refWsMessage.current = onWsMessage; });
useEffect(() => { useEffect(() => {
if (ws !== hack) {
console.log(`board - setting out-of-scope hack`);
hack = ws;
}
if (!ws) { return; } if (!ws) { return; }
console.log('board - bind'); console.log('board - bind');
const cbMessage = e => refWsMessage.current(e); const cbMessage = e => refWsMessage.current(e);
@ -221,7 +215,6 @@ const Board = () => {
} else { } else {
type = 'place-settlement'; type = 'place-settlement';
} }
if (!hack) { console.error(`board - onCornerClicked - ws is NULL`); return; }
ws.send(JSON.stringify({ ws.send(JSON.stringify({
type, index: corner.index type, index: corner.index
})); }));