summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorVictor Chabbert <chabbertvi@eisti.eu>2016-12-21 00:03:56 +0100
committerVictor Chabbert <chabbertvi@eisti.eu>2016-12-21 00:03:56 +0100
commit32551149a85a82f7511e1f8a6151d49c08a09462 (patch)
tree77b0c5a1f4b8c8be2cd85d726aa1bc588f8baec2 /src/main
parentAdd interceptor for invalid subscriptions (diff)
downloadseven-wonders-32551149a85a82f7511e1f8a6151d49c08a09462.tar.gz
seven-wonders-32551149a85a82f7511e1f8a6151d49c08a09462.tar.bz2
seven-wonders-32551149a85a82f7511e1f8a6151d49c08a09462.zip
Fix json not parsing errors
Diffstat (limited to 'src/main')
-rw-r--r--src/main/js/src/containers/App/saga.js2
-rw-r--r--src/main/js/src/containers/GameBrowser/saga.js1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/main/js/src/containers/App/saga.js b/src/main/js/src/containers/App/saga.js
index f1f72dfd..0c212142 100644
--- a/src/main/js/src/containers/App/saga.js
+++ b/src/main/js/src/containers/App/saga.js
@@ -3,7 +3,7 @@ import { eventChannel } from 'redux-saga'
function createSocketChannel(socket) {
return eventChannel(emit => {
- const errorHandler = event => emit(JSON.parse(event))
+ const errorHandler = event => emit(JSON.parse(event.body))
const userErrors = socket.subscribe('/user/queue/errors', errorHandler)
diff --git a/src/main/js/src/containers/GameBrowser/saga.js b/src/main/js/src/containers/GameBrowser/saga.js
index 8f947683..f28f5562 100644
--- a/src/main/js/src/containers/GameBrowser/saga.js
+++ b/src/main/js/src/containers/GameBrowser/saga.js
@@ -8,6 +8,7 @@ function createSocketChannel(socket) {
return eventChannel(emit => {
const makeHandler = (type) => (event) => {
const response = JSON.parse(event.body)
+
emit({
type,
response
bgstack15