vitogit / vue-chessboard

Chessboard vue component to load positions, create positions and see threats
http://vitomd.com/vue-chessboard-examples/
GNU General Public License v3.0
165 stars 49 forks source link

fixed edge case for promoting immediately after FEN is loaded #41

Closed ghost closed 2 years ago

ghost commented 2 years ago

If the developer/user loads the following FEN, '8/8/Q7/3n4/6P1/K7/1pkn4/5B2 b - - 0 1', the promote function provided via the prop is not recognized until after the first move.

This pull request updates the this.promotions array in the mounted function.

To see this in action, I have made a second branch, https://github.com/jmil-hall/vue-chessboard/tree/test-bug-fix, that tests the bug fix.