From ed5fc9d8ea7945b615bfa77537cbf9b7fad3bf1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5var=20Aamb=C3=B8=20Fosstveit?= Date: Wed, 31 Oct 2018 12:41:03 +0100 Subject: [PATCH] Added cookie consent and fixed bug in server --- app/lib/components/Room.jsx | 6 ++++++ app/package.json | 1 + server/lib/Room.js | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/lib/components/Room.jsx b/app/lib/components/Room.jsx index 4a0b145..53cc034 100644 --- a/app/lib/components/Room.jsx +++ b/app/lib/components/Room.jsx @@ -4,6 +4,7 @@ import ReactTooltip from 'react-tooltip'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import CopyToClipboard from 'react-copy-to-clipboard'; +import CookieConsent from 'react-cookie-consent'; import * as appPropTypes from './appPropTypes'; import * as requestActions from '../redux/requestActions'; import * as stateActions from '../redux/stateActions'; @@ -81,7 +82,12 @@ class Room extends React.Component
+ + This website uses cookies to enhance the user experience. + + +
diff --git a/app/package.json b/app/package.json index f4a3bbc..ff04fbd 100644 --- a/app/package.json +++ b/app/package.json @@ -23,6 +23,7 @@ "prop-types": "^15.6.2", "random-string": "^0.2.0", "react": "^16.5.2", + "react-cookie-consent": "^1.9.0", "react-copy-to-clipboard": "^5.0.1", "react-dom": "^16.5.2", "react-draggable": "^3.0.5", diff --git a/server/lib/Room.js b/server/lib/Room.js index 53c1696..b688a63 100644 --- a/server/lib/Room.js +++ b/server/lib/Room.js @@ -82,7 +82,8 @@ class Room extends EventEmitter if (this._signalingPeers) for (let peer of this._signalingPeers) { - peer.socket.disconnect(); + if (peer.socket) + peer.socket.disconnect(); }; this._signalingPeers.clear();