From c700d7035ce21aa550d8cd77000024aead557ba7 Mon Sep 17 00:00:00 2001 From: l12s Date: Mon, 15 Feb 2016 16:00:04 -0800 Subject: [PATCH] Updates message-handlers for `team_xxx` events to write the team back to the data-store --- CHANGELOG.md | 6 ++++++ lib/data-store/message-handlers/team.js | 3 +++ package.json | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7a298514..47dc3bb56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +### v2.0.2 (2016-02-15) + + * Adds coveralls to the repo, to track code coverage and display a badge in the README + * Updates the disconnect function on the RTM client to support both an error message and a code or reason for the disconnect, e.g. `account_inactive` + * Updates the message-handlers for `team_xxx` events to set the team back to the data-store once changes are made + ### v2.0.1 (2016-02-13) * Updates to `ws@1.0.1` diff --git a/lib/data-store/message-handlers/team.js b/lib/data-store/message-handlers/team.js index 2b0d78355..ddf3ca043 100644 --- a/lib/data-store/message-handlers/team.js +++ b/lib/data-store/message-handlers/team.js @@ -14,6 +14,7 @@ var handleTeamDomainChange = function handleTeamDomainChange( var team = dataStore.getTeamById(activeTeamId); team.domain = message.domain; team.url = message.url; + dataStore.setTeam(team); }; @@ -21,6 +22,7 @@ var handleTeamDomainChange = function handleTeamDomainChange( var handleTeamRename = function handleTeamRename(activeUserId, activeTeamId, dataStore, message) { var team = dataStore.getTeamById(activeTeamId); team.name = message.name; + dataStore.setTeam(team); }; @@ -29,6 +31,7 @@ var handleTeamPrefChange = function handleTeamPrefChange( activeUserId, activeTeamId, dataStore, message) { var team = dataStore.getTeamById(activeTeamId); team.prefs[message.name] = message.value; + dataStore.setTeam(team); }; diff --git a/package.json b/package.json index 2978acac6..abc5633af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "slack-client", - "version": "2.0.1", + "version": "2.0.2", "description": "A library for creating a Slack client", "main": "./index", "scripts": {