diff --git a/CHANGELOG.md b/CHANGELOG.md index 009c5d41..01b06b18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,6 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). - ## [1.6.5] - 2019-10-27 # Added - Offering of draws diff --git a/VERSION b/VERSION index 49ebdd60..83d1a5eb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.5 \ No newline at end of file +1.6.6 \ No newline at end of file diff --git a/acp/package.json b/acp/package.json index 2591fabe..a1935bb7 100644 --- a/acp/package.json +++ b/acp/package.json @@ -1,6 +1,6 @@ { "name": "mnml-client", - "version": "1.6.5", + "version": "1.6.6", "description": "", "main": "index.js", "scripts": { diff --git a/client/package.json b/client/package.json index 790e7aed..b6b1c359 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "mnml-client", - "version": "1.6.5", + "version": "1.6.6", "description": "", "main": "index.js", "scripts": { diff --git a/client/src/components/game.ctrl.btns.top.jsx b/client/src/components/game.ctrl.btns.top.jsx index 4b81670c..8e09718c 100644 --- a/client/src/components/game.ctrl.btns.top.jsx +++ b/client/src/components/game.ctrl.btns.top.jsx @@ -8,6 +8,7 @@ const addState = connect( const { ws, game, + account, } = state; function sendAbandon() { @@ -20,6 +21,7 @@ const addState = connect( return { game, + account, sendAbandon, sendDraw, @@ -39,6 +41,7 @@ const addState = connect( function GameCtrlTopBtns(args) { const { game, + account, leave, sendAbandon, @@ -48,6 +51,9 @@ function GameCtrlTopBtns(args) { const finished = game && game.phase === 'Finished'; const { abandonState, drawState } = this.state; + const player = game.players.find(p => p.id === account.id); + const drawOffered = player && player.draw_offered; + const abandonStateTrue = e => { e.stopPropagation(); this.setState({ abandonState: true }); @@ -66,10 +72,12 @@ function GameCtrlTopBtns(args) { const abandonBtn = ; - const drawClasses = `draw ${drawState ? 'confirming' : ''}`; - const drawText = drawState ? 'Draw' : 'Offer'; + const drawClasses = `draw ${drawState || drawOffered ? 'confirming' : ''}`; + const drawText = drawOffered + ? 'Offered' + : drawState ? 'Draw' : 'Offer'; const drawAction = drawState ? sendDraw : drawStateTrue; - const drawBtn = ; + const drawBtn = ; return (