From 32551149a85a82f7511e1f8a6151d49c08a09462 Mon Sep 17 00:00:00 2001 From: Victor Chabbert Date: Wed, 21 Dec 2016 00:03:56 +0100 Subject: Fix json not parsing errors --- src/main/js/src/containers/App/saga.js | 2 +- src/main/js/src/containers/GameBrowser/saga.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main') 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 -- cgit