Giter Site home page Giter Site logo

spablab's People

Contributors

abhi1234-tech avatar ahmedibrahim404 avatar arturas1989 avatar ayush-chandil avatar billymoroney1 avatar codemaster7000 avatar corners2wall avatar denyslins avatar divyateja04 avatar dotarjun avatar endbug avatar faisalhs51 avatar hpa16 avatar jeffersonsimaogoncalves avatar jkirito avatar joshl26 avatar lokeshn011101 avatar luzefiru avatar mithilesh-create avatar neeravbhaskarla avatar paultristanwagner avatar piyush-deshmukh avatar programarivm avatar smashedfrenzy16 avatar techmannih avatar tharuneshwar-neo avatar venustokyo avatar vishesh-pandey avatar vladutvoicu avatar vtprince avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

spablab's Issues

Add a user-friendly breadcrumb

Add a breadcrumb above the PGN movetext section to just remind users whether they're playing in Analysis board mode or Invite a friend mode.

figure-01
Figure 1. 1.e4 e5 in Analysis board mode

figure-02
Figure 2. 1.e4 e5 in Invite a friend mode

This issue is meant to be a usability improvement.

Display an informative message after inviting a friend to play

At this moment, nothing is displayed after clicking on the Play button, which is a little confusing for the user sending the invite.

invite-friend-01
Figure 1. Invite a friend to play

invite-friend-02
Figure 2. This is the screen displayed after clicking on the Play button

However, an informative message should be displayed:

  • Waiting for friend to accept the invite...

Chessboard not being displayed on several different browsers

The chessboard gets displayed on Chrome but the following ones will throw an error instead:

  • Falcon
  • Abrowser
  • Midori
×
TypeError: b is undefined
compose/</<
node_modules/redux/es/redux.js:621

  618 | 
  619 |   return funcs.reduce(function (a, b) {
  620 |     return function () {
> 621 |       return a(b.apply(void 0, arguments));
  622 |     };
  623 |   });
  624 | }

createStore
http://localhost:3000/static/js/vendors~main.chunk.js:39696:12

  39693 |     throw new Error( false ? undefined : "Expected the enhancer to be a function. Instead, received: '" + kindOf(enhancer) + "'");
  39694 |   }
  39695 | 
> 39696 |   return enhancer(createStore)(reducer, preloadedState);
        |          ^  39697 | }
  39698 | 
  39699 | if (typeof reducer !== 'function') {

./node_modules/redux-chess/dist/store.js
node_modules/redux-chess/dist/store.js:19

  16 | 
  17 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  18 | 
> 19 | var store = (0, _redux.createStore)(_rootReducer2.default, (0, _redux.compose)((0, _redux.applyMiddleware)(_reduxThunk2.default), window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()));
  20 | 
  21 | // const store = createStore(rootReducer, applyMiddleware(thunk));
  22 | 

__webpack_require__
/home/standard/projects/testing-redux-chess/webpack/bootstrap:851

  848 | 
  849 | __webpack_require__.$Refresh$.init();
  850 | try {
> 851 | 	modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
      | ^  852 | } finally {
  853 | 	__webpack_require__.$Refresh$.cleanup(moduleId);
  854 | }

fn
/home/standard/projects/testing-redux-chess/webpack/bootstrap:150

  147 | 		);
  148 | 		hotCurrentParents = [];
  149 | 	}
> 150 | 	return __webpack_require__(request);
      | ^  151 | };
  152 | var ObjectFactory = function ObjectFactory(name) {
  153 | 	return {

./node_modules/redux-chess/dist/components/Chess.js
node_modules/redux-chess/dist/components/Chess.js:13
__webpack_require__
/home/standard/projects/testing-redux-chess/webpack/bootstrap:851

  848 | 
  849 | __webpack_require__.$Refresh$.init();
  850 | try {
> 851 | 	modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
      | ^  852 | } finally {
  853 | 	__webpack_require__.$Refresh$.cleanup(moduleId);
  854 | }

fn
/home/standard/projects/testing-redux-chess/webpack/bootstrap:150

  147 | 		);
  148 | 		hotCurrentParents = [];
  149 | 	}
> 150 | 	return __webpack_require__(request);
      | ^  151 | };
  152 | var ObjectFactory = function ObjectFactory(name) {
  153 | 	return {

./node_modules/redux-chess/dist/index.js
node_modules/redux-chess/dist/index.js:8
__webpack_require__
/home/standard/projects/testing-redux-chess/webpack/bootstrap:851

  848 | 
  849 | __webpack_require__.$Refresh$.init();
  850 | try {
> 851 | 	modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
      | ^  852 | } finally {
  853 | 	__webpack_require__.$Refresh$.cleanup(moduleId);
  854 | }

fn
/home/standard/projects/testing-redux-chess/webpack/bootstrap:150

  147 | 		);
  148 | 		hotCurrentParents = [];
  149 | 	}
> 150 | 	return __webpack_require__(request);
      | ^  151 | };
  152 | var ObjectFactory = function ObjectFactory(name) {
  153 | 	return {

__webpack_require__
/home/standard/projects/testing-redux-chess/webpack/bootstrap:851

  848 | 
  849 | __webpack_require__.$Refresh$.init();
  850 | try {
> 851 | 	modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
      | ^  852 | } finally {
  853 | 	__webpack_require__.$Refresh$.cleanup(moduleId);
  854 | }

fn
/home/standard/projects/testing-redux-chess/webpack/bootstrap:150

  147 | 		);
  148 | 		hotCurrentParents = [];
  149 | 	}
> 150 | 	return __webpack_require__(request);
      | ^  151 | };
  152 | var ObjectFactory = function ObjectFactory(name) {
  153 | 	return {

1
http://localhost:3000/static/js/main.chunk.js:127:18
__webpack_require__
/home/standard/projects/testing-redux-chess/webpack/bootstrap:851

  848 | 
  849 | __webpack_require__.$Refresh$.init();
  850 | try {
> 851 | 	modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
      | ^  852 | } finally {
  853 | 	__webpack_require__.$Refresh$.cleanup(moduleId);
  854 | }

checkDeferredModules
/home/standard/projects/testing-redux-chess/webpack/bootstrap:45

  42 | 	}
  43 | 	if(fulfilled) {
  44 | 		deferredModules.splice(i--, 1);
> 45 | 		result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
     | ^  46 | 	}
  47 | }
  48 | 

webpackJsonpCallback
/home/standard/projects/testing-redux-chess/webpack/bootstrap:32

  29 | 	deferredModules.push.apply(deferredModules, executeModules || []);
  30 | 
  31 | 	// run deferred modules when all chunks ready
> 32 | 	return checkDeferredModules();
     | ^  33 | };
  34 | function checkDeferredModules() {
  35 | 	var result;

(anonymous function)
http://localhost:3000/static/js/main.chunk.js:1:91
This screen is visible only in development. It will not appear if the app crashes in production.
Open your browser’s developer console to further inspect this error.  Click the 'X' or hit ESC to dismiss this message.

Hide the 'Connect' button

The chessboard should connect to the server automatically after loading.

Instead, display the 'Connect' button if the connection is lost -- or alternatively display an informative message asking the user to reload the page.

Display two chess timers instead of one

At this moment only one chess timer is being displayed, as it is shown in the image attached. However two chess timers should be displayed instead, one per player.

Screenshot 2021-07-12 22:24:27

Allow to initialize the Chess component with the given protocol: ws or wss

The prot property should be added to the props of the Chess component as shown in the examples below.

ws protocol:

import React from 'react';
import ReactDOM from 'react-dom';
import { Chess } from 'redux-chess';

const props = {
  server: {
    prot: 'ws',
    host: '127.0.0.1',
    port: '8080'
  }
};

ReactDOM.render(
  <Chess props={props} />,
  document.getElementById('redux-chess')
);

wss protocol:

import React from 'react';
import ReactDOM from 'react-dom';
import { Chess } from 'redux-chess';

const props = {
  server: {
    prot: 'wss',
    host: 'pchess.net',
    port: '8443'
  }
};

ReactDOM.render(
  <Chess props={props} />,
  document.getElementById('redux-chess')
);

Wording cleanup

The following menu options should be renamed as it is described next.

  • Create invitation to Create invite code
  • Enter code to Enter invite code

wording-cleanup

Review JWT tokens in 'Play with a friend' mode

Atm the browser is not storing the JWT token, so no session management is actually being used.

So for example, until now time has been hard-coded throughout the entire app as shown in the following WebSocket message listener.

export const onPlayfriend = (data) => dispatch => {
  dispatch({
    type: createInvitationDialogActionTypes.CREATE_CODE,
    payload: {
      color: data['/start'].color,
      time: 10, // TODO
      code: data['/start'].hash
    }
  });
};

Session tokens should be reviewed.

Secure the WebSocket connections

Now that a sandbox chess server has been setup for testing purposes, it seems as if the WebSocket connections should be secured in order for this demo to run without security issues.

Chrome:

Mixed Content: The page at 'https://programarivm.com/demo-redux-chess/' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://3.121.169.246:8080/'. This request has been blocked; this endpoint must be available over WSS.

Firefox:

Uncaught (in promise) DOMException: The operation is insecure.

See chesslablab/chess-server#2

Fix the warnings thrown when running the 'is rendered' test in Chess.test.js

Even though the test pass in __tests__/components/Chess.test.js, the following warnings are displayed when running npm test

 PASS  src/__tests__/utils/Ascii.test.js
 PASS  src/__tests__/utils/Piece.test.js
 PASS  src/__tests__/components/Chess.test.js
  ● Console

    console.error
      Warning: Failed prop type: Invalid prop `variant` of value `text` supplied to `ForwardRef(Menu)`, expected one of ["menu","selectedMenu"].
          at Menu (/home/standard/projects/redux-chess/node_modules/@material-ui/core/Menu/Menu.js:67:32)
          at WithStyles(ForwardRef(Menu)) (/home/standard/projects/redux-chess/node_modules/@material-ui/styles/withStyles/withStyles.js:67:31)
          at div
          at ButtonGroup (/home/standard/projects/redux-chess/node_modules/@material-ui/core/ButtonGroup/ButtonGroup.js:207:24)
          at WithStyles(ForwardRef(ButtonGroup)) (/home/standard/projects/redux-chess/node_modules/@material-ui/styles/withStyles/withStyles.js:67:31)
          at Settings (/home/standard/projects/redux-chess/src/components/Buttons.js:14:20)
          at Provider (/home/standard/projects/redux-chess/node_modules/react-redux/lib/components/Provider.js:21:20)
          at Chess (/home/standard/projects/redux-chess/src/components/Chess.js:12:17)
          at WrapperComponent (/home/standard/projects/redux-chess/node_modules/enzyme-adapter-utils/src/createMountWrapper.jsx:49:26)

      at printWarning (node_modules/react/cjs/react.development.js:220:30)
      at error (node_modules/react/cjs/react.development.js:196:5)
      at checkPropTypes (node_modules/react/cjs/react.development.js:1935:11)
      at validatePropTypes (node_modules/react/cjs/react.development.js:2136:7)
      at Object.createElementWithValidation [as createElement] (node_modules/react/cjs/react.development.js:2240:5)
      at WithStyles(ForwardRef(Menu)) (node_modules/@material-ui/styles/withStyles/withStyles.js:97:42)
      at renderWithHooks (node_modules/react-dom/cjs/react-dom.development.js:14985:18)
      at updateForwardRef (node_modules/react-dom/cjs/react-dom.development.js:17044:20)

    console.error
      Warning: Failed prop type: Invalid prop `variant` of value `text` supplied to `ForwardRef(MenuList)`, expected one of ["menu","selectedMenu"].
          at MenuList (/home/standard/projects/redux-chess/node_modules/@material-ui/core/MenuList/MenuList.js:117:23)
          at Menu (/home/standard/projects/redux-chess/node_modules/@material-ui/core/Menu/Menu.js:67:32)
          at WithStyles(ForwardRef(Menu)) (/home/standard/projects/redux-chess/node_modules/@material-ui/styles/withStyles/withStyles.js:67:31)
          at div
          at ButtonGroup (/home/standard/projects/redux-chess/node_modules/@material-ui/core/ButtonGroup/ButtonGroup.js:207:24)
          at WithStyles(ForwardRef(ButtonGroup)) (/home/standard/projects/redux-chess/node_modules/@material-ui/styles/withStyles/withStyles.js:67:31)
          at Settings (/home/standard/projects/redux-chess/src/components/Buttons.js:14:20)
          at Provider (/home/standard/projects/redux-chess/node_modules/react-redux/lib/components/Provider.js:21:20)
          at Chess (/home/standard/projects/redux-chess/src/components/Chess.js:12:17)
          at WrapperComponent (/home/standard/projects/redux-chess/node_modules/enzyme-adapter-utils/src/createMountWrapper.jsx:49:26)

      at printWarning (node_modules/react/cjs/react.development.js:220:30)
      at error (node_modules/react/cjs/react.development.js:196:5)
      at checkPropTypes (node_modules/react/cjs/react.development.js:1935:11)
      at validatePropTypes (node_modules/react/cjs/react.development.js:2136:7)
      at Object.createElementWithValidation [as createElement] (node_modules/react/cjs/react.development.js:2240:5)
      at Menu (node_modules/@material-ui/core/Menu/Menu.js:182:33)
      at renderWithHooks (node_modules/react-dom/cjs/react-dom.development.js:14985:18)
      at updateForwardRef (node_modules/react-dom/cjs/react-dom.development.js:17044:20)

    console.error
      Warning: Invalid DOM property `tabindex`. Did you mean `tabIndex`?
          at span
          at div
          at div
          at div
          at div
          at Board (/home/standard/projects/redux-chess/src/components/Board.js:13:17)
          at Provider (/home/standard/projects/redux-chess/node_modules/react-redux/lib/components/Provider.js:21:20)
          at Chess (/home/standard/projects/redux-chess/src/components/Chess.js:12:17)
          at WrapperComponent (/home/standard/projects/redux-chess/node_modules/enzyme-adapter-utils/src/createMountWrapper.jsx:49:26)

      at printWarning (node_modules/react-dom/cjs/react-dom.development.js:67:30)
      at error (node_modules/react-dom/cjs/react-dom.development.js:43:5)
      at validateProperty$1 (node_modules/react-dom/cjs/react-dom.development.js:3505:9)
      at warnUnknownProperties (node_modules/react-dom/cjs/react-dom.development.js:3559:21)
      at validateProperties$2 (node_modules/react-dom/cjs/react-dom.development.js:3583:3)
      at validatePropertiesInDevelopment (node_modules/react-dom/cjs/react-dom.development.js:8765:5)
      at setInitialProperties (node_modules/react-dom/cjs/react-dom.development.js:9041:5)
      at finalizeInitialChildren (node_modules/react-dom/cjs/react-dom.development.js:10201:3)

    console.error
      Warning: React does not recognize the `disableElevation` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `disableelevation` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
          at div
          at Portal (/home/standard/projects/redux-chess/node_modules/@material-ui/core/Portal/Portal.js:39:24)
          at Modal (/home/standard/projects/redux-chess/node_modules/@material-ui/core/Modal/Modal.js:94:36)
          at Popover (/home/standard/projects/redux-chess/node_modules/@material-ui/core/Popover/Popover.js:118:22)
          at WithStyles(ForwardRef(Popover)) (/home/standard/projects/redux-chess/node_modules/@material-ui/styles/withStyles/withStyles.js:67:31)
          at Menu (/home/standard/projects/redux-chess/node_modules/@material-ui/core/Menu/Menu.js:67:32)
          at WithStyles(ForwardRef(Menu)) (/home/standard/projects/redux-chess/node_modules/@material-ui/styles/withStyles/withStyles.js:67:31)
          at div
          at ButtonGroup (/home/standard/projects/redux-chess/node_modules/@material-ui/core/ButtonGroup/ButtonGroup.js:207:24)
          at WithStyles(ForwardRef(ButtonGroup)) (/home/standard/projects/redux-chess/node_modules/@material-ui/styles/withStyles/withStyles.js:67:31)
          at Settings (/home/standard/projects/redux-chess/src/components/Buttons.js:14:20)
          at Provider (/home/standard/projects/redux-chess/node_modules/react-redux/lib/components/Provider.js:21:20)
          at Chess (/home/standard/projects/redux-chess/src/components/Chess.js:12:17)
          at WrapperComponent (/home/standard/projects/redux-chess/node_modules/enzyme-adapter-utils/src/createMountWrapper.jsx:49:26)

      at printWarning (node_modules/react-dom/cjs/react-dom.development.js:67:30)
      at error (node_modules/react-dom/cjs/react-dom.development.js:43:5)
      at validateProperty$1 (node_modules/react-dom/cjs/react-dom.development.js:3513:7)
      at warnUnknownProperties (node_modules/react-dom/cjs/react-dom.development.js:3559:21)
      at validateProperties$2 (node_modules/react-dom/cjs/react-dom.development.js:3583:3)
      at validatePropertiesInDevelopment (node_modules/react-dom/cjs/react-dom.development.js:8765:5)
      at setInitialProperties (node_modules/react-dom/cjs/react-dom.development.js:9041:5)
      at finalizeInitialChildren (node_modules/react-dom/cjs/react-dom.development.js:10201:3)

    console.error
      Warning: React does not recognize the `disableFocusRipple` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `disablefocusripple` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
          at div
          at Portal (/home/standard/projects/redux-chess/node_modules/@material-ui/core/Portal/Portal.js:39:24)
          at Modal (/home/standard/projects/redux-chess/node_modules/@material-ui/core/Modal/Modal.js:94:36)
          at Popover (/home/standard/projects/redux-chess/node_modules/@material-ui/core/Popover/Popover.js:118:22)
          at WithStyles(ForwardRef(Popover)) (/home/standard/projects/redux-chess/node_modules/@material-ui/styles/withStyles/withStyles.js:67:31)
          at Menu (/home/standard/projects/redux-chess/node_modules/@material-ui/core/Menu/Menu.js:67:32)
          at WithStyles(ForwardRef(Menu)) (/home/standard/projects/redux-chess/node_modules/@material-ui/styles/withStyles/withStyles.js:67:31)
          at div
          at ButtonGroup (/home/standard/projects/redux-chess/node_modules/@material-ui/core/ButtonGroup/ButtonGroup.js:207:24)
          at WithStyles(ForwardRef(ButtonGroup)) (/home/standard/projects/redux-chess/node_modules/@material-ui/styles/withStyles/withStyles.js:67:31)
          at Settings (/home/standard/projects/redux-chess/src/components/Buttons.js:14:20)
          at Provider (/home/standard/projects/redux-chess/node_modules/react-redux/lib/components/Provider.js:21:20)
          at Chess (/home/standard/projects/redux-chess/src/components/Chess.js:12:17)
          at WrapperComponent (/home/standard/projects/redux-chess/node_modules/enzyme-adapter-utils/src/createMountWrapper.jsx:49:26)

      at printWarning (node_modules/react-dom/cjs/react-dom.development.js:67:30)
      at error (node_modules/react-dom/cjs/react-dom.development.js:43:5)
      at validateProperty$1 (node_modules/react-dom/cjs/react-dom.development.js:3513:7)
      at warnUnknownProperties (node_modules/react-dom/cjs/react-dom.development.js:3559:21)
      at validateProperties$2 (node_modules/react-dom/cjs/react-dom.development.js:3583:3)
      at validatePropertiesInDevelopment (node_modules/react-dom/cjs/react-dom.development.js:8765:5)
      at setInitialProperties (node_modules/react-dom/cjs/react-dom.development.js:9041:5)
      at finalizeInitialChildren (node_modules/react-dom/cjs/react-dom.development.js:10201:3)

    console.error
      Warning: React does not recognize the `disableRipple` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `disableripple` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
          at div
          at Portal (/home/standard/projects/redux-chess/node_modules/@material-ui/core/Portal/Portal.js:39:24)
          at Modal (/home/standard/projects/redux-chess/node_modules/@material-ui/core/Modal/Modal.js:94:36)
          at Popover (/home/standard/projects/redux-chess/node_modules/@material-ui/core/Popover/Popover.js:118:22)
          at WithStyles(ForwardRef(Popover)) (/home/standard/projects/redux-chess/node_modules/@material-ui/styles/withStyles/withStyles.js:67:31)
          at Menu (/home/standard/projects/redux-chess/node_modules/@material-ui/core/Menu/Menu.js:67:32)
          at WithStyles(ForwardRef(Menu)) (/home/standard/projects/redux-chess/node_modules/@material-ui/styles/withStyles/withStyles.js:67:31)
          at div
          at ButtonGroup (/home/standard/projects/redux-chess/node_modules/@material-ui/core/ButtonGroup/ButtonGroup.js:207:24)
          at WithStyles(ForwardRef(ButtonGroup)) (/home/standard/projects/redux-chess/node_modules/@material-ui/styles/withStyles/withStyles.js:67:31)
          at Settings (/home/standard/projects/redux-chess/src/components/Buttons.js:14:20)
          at Provider (/home/standard/projects/redux-chess/node_modules/react-redux/lib/components/Provider.js:21:20)
          at Chess (/home/standard/projects/redux-chess/src/components/Chess.js:12:17)
          at WrapperComponent (/home/standard/projects/redux-chess/node_modules/enzyme-adapter-utils/src/createMountWrapper.jsx:49:26)

      at printWarning (node_modules/react-dom/cjs/react-dom.development.js:67:30)
      at error (node_modules/react-dom/cjs/react-dom.development.js:43:5)
      at validateProperty$1 (node_modules/react-dom/cjs/react-dom.development.js:3513:7)
      at warnUnknownProperties (node_modules/react-dom/cjs/react-dom.development.js:3559:21)
      at validateProperties$2 (node_modules/react-dom/cjs/react-dom.development.js:3583:3)
      at validatePropertiesInDevelopment (node_modules/react-dom/cjs/react-dom.development.js:8765:5)
      at setInitialProperties (node_modules/react-dom/cjs/react-dom.development.js:9041:5)
      at finalizeInitialChildren (node_modules/react-dom/cjs/react-dom.development.js:10201:3)

    console.error
      Warning: React does not recognize the `fullWidth` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `fullwidth` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
          at div
          at Portal (/home/standard/projects/redux-chess/node_modules/@material-ui/core/Portal/Portal.js:39:24)
          at Modal (/home/standard/projects/redux-chess/node_modules/@material-ui/core/Modal/Modal.js:94:36)
          at Popover (/home/standard/projects/redux-chess/node_modules/@material-ui/core/Popover/Popover.js:118:22)
          at WithStyles(ForwardRef(Popover)) (/home/standard/projects/redux-chess/node_modules/@material-ui/styles/withStyles/withStyles.js:67:31)
          at Menu (/home/standard/projects/redux-chess/node_modules/@material-ui/core/Menu/Menu.js:67:32)
          at WithStyles(ForwardRef(Menu)) (/home/standard/projects/redux-chess/node_modules/@material-ui/styles/withStyles/withStyles.js:67:31)
          at div
          at ButtonGroup (/home/standard/projects/redux-chess/node_modules/@material-ui/core/ButtonGroup/ButtonGroup.js:207:24)
          at WithStyles(ForwardRef(ButtonGroup)) (/home/standard/projects/redux-chess/node_modules/@material-ui/styles/withStyles/withStyles.js:67:31)
          at Settings (/home/standard/projects/redux-chess/src/components/Buttons.js:14:20)
          at Provider (/home/standard/projects/redux-chess/node_modules/react-redux/lib/components/Provider.js:21:20)
          at Chess (/home/standard/projects/redux-chess/src/components/Chess.js:12:17)
          at WrapperComponent (/home/standard/projects/redux-chess/node_modules/enzyme-adapter-utils/src/createMountWrapper.jsx:49:26)

      at printWarning (node_modules/react-dom/cjs/react-dom.development.js:67:30)
      at error (node_modules/react-dom/cjs/react-dom.development.js:43:5)
      at validateProperty$1 (node_modules/react-dom/cjs/react-dom.development.js:3513:7)
      at warnUnknownProperties (node_modules/react-dom/cjs/react-dom.development.js:3559:21)
      at validateProperties$2 (node_modules/react-dom/cjs/react-dom.development.js:3583:3)
      at validatePropertiesInDevelopment (node_modules/react-dom/cjs/react-dom.development.js:8765:5)
      at setInitialProperties (node_modules/react-dom/cjs/react-dom.development.js:9041:5)
      at finalizeInitialChildren (node_modules/react-dom/cjs/react-dom.development.js:10201:3)


Test Suites: 3 passed, 3 total
Tests:       20 passed, 20 total
Snapshots:   0 total
Time:        5.249 s
Ran all test suites.

Watch Usage: Press w to show more.

Close the existing WSS connection when connecting to the server

The existing WSS connection, if any, should be closed when selecting the Connect option from the Settings menu in order to open a new one. Please note that at this moment, a web browser can open multiple connections as it is shown in the example attached.

figure-01

Here is how a storage/pchess.log file would look like in the chess server when a browser is opening multiple connections.

...
[2021-07-30T09:23:48.140937+00:00] pchess.net.INFO: New connection {"id":309} []
[2021-07-30T09:23:48.314296+00:00] pchess.net.INFO: Sent message {"id":309,"res":{"/start":{"mode":"analysis"}}} []
[2021-07-30T09:23:50.282301+00:00] pchess.net.INFO: New connection {"id":313} []
[2021-07-30T09:23:50.442348+00:00] pchess.net.INFO: Sent message {"id":313,"res":{"/start":{"mode":"analysis"}}} []
[2021-07-30T09:24:58.076394+00:00] pchess.net.INFO: New connection {"id":317} []
[2021-07-30T09:24:58.267724+00:00] pchess.net.INFO: Sent message {"id":317,"res":{"/start":{"mode":"analysis"}}} []
[2021-07-30T09:24:59.943299+00:00] pchess.net.INFO: New connection {"id":321} []
[2021-07-30T09:25:00.107025+00:00] pchess.net.INFO: Sent message {"id":321,"res":{"/start":{"mode":"analysis"}}} []
[2021-07-30T09:25:01.498512+00:00] pchess.net.INFO: New connection {"id":325} []
[2021-07-30T09:25:01.660591+00:00] pchess.net.INFO: Sent message {"id":325,"res":{"/start":{"mode":"analysis"}}} []
[2021-07-30T09:25:02.934983+00:00] pchess.net.INFO: New connection {"id":329} []
[2021-07-30T09:25:03.093671+00:00] pchess.net.INFO: Sent message {"id":329,"res":{"/start":{"mode":"analysis"}}} []
[2021-07-30T09:25:44.930207+00:00] pchess.net.INFO: New connection {"id":333} []
[2021-07-30T09:25:45.118214+00:00] pchess.net.INFO: Sent message {"id":333,"res":{"/start":{"mode":"analysis"}}} []
[2021-07-30T09:25:46.847560+00:00] pchess.net.INFO: New connection {"id":337} []
[2021-07-30T09:25:47.009816+00:00] pchess.net.INFO: Sent message {"id":337,"res":{"/start":{"mode":"analysis"}}} []
[2021-07-30T09:26:00.435722+00:00] pchess.net.INFO: Closed connection {"id":325} []
[2021-07-30T09:26:00.436104+00:00] pchess.net.INFO: Closed connection {"id":317} []
[2021-07-30T09:26:00.436279+00:00] pchess.net.INFO: Closed connection {"id":329} []
[2021-07-30T09:26:00.436602+00:00] pchess.net.INFO: Closed connection {"id":333} []
[2021-07-30T09:26:00.436903+00:00] pchess.net.INFO: Closed connection {"id":153} []
[2021-07-30T09:26:00.437068+00:00] pchess.net.INFO: Closed connection {"id":321} []
[2021-07-30T09:26:00.437325+00:00] pchess.net.INFO: Closed connection {"id":337} []

Allow to deselect a piece already selected

At this moment a selected piece cannot be deselected, so players are forced to move the current piece that has been clicked on. Instead, players should be allowed to deselect the piece by clicking on it again.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.