From e92dfd8284a26fdc93b92e230ddac15914a98b58 Mon Sep 17 00:00:00 2001 From: Lukas Martinelli Date: Sun, 1 Jan 2017 15:51:22 +0100 Subject: [PATCH] Fix local update to right this --- src/libs/apistore.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/apistore.js b/src/libs/apistore.js index 4a18576..27016ee 100644 --- a/src/libs/apistore.js +++ b/src/libs/apistore.js @@ -28,14 +28,14 @@ export class ApiStyleStore { notifyLocalChanges() { const connection = new ReconnectingWebSocket(websocketUrl) - connection.onmessage = function(e) { + connection.onmessage = e => { if(!e.data) return + console.log('Received style update from API') try { - console.log('Received style update from API') const updatedStyle = style.ensureStyleValidity(JSON.parse(e.data)) this.onLocalStyleChange(updatedStyle) } catch(err) { - console.error('Cannot parse local file ' + e.data) + console.error('Could not parse local style') } } }