From 6616cf0c51df21ffc9e99f97ee7d67f9522e40c6 Mon Sep 17 00:00:00 2001 From: David Jay Date: Wed, 9 Nov 2016 13:42:03 -0500 Subject: [PATCH] Uncommenting flags and hydrating actions. --- .../coral-embed-stream/src/CommentStream.js | 28 ++++++++----------- client/coral-framework/store/actions/items.js | 12 ++++++-- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/client/coral-embed-stream/src/CommentStream.js b/client/coral-embed-stream/src/CommentStream.js index cda7ffd57..65e02e2ee 100644 --- a/client/coral-embed-stream/src/CommentStream.js +++ b/client/coral-embed-stream/src/CommentStream.js @@ -123,14 +123,12 @@ class CommentStream extends Component {
- { - // - } + @@ -153,14 +151,12 @@ class CommentStream extends Component {
- { - // - } + diff --git a/client/coral-framework/store/actions/items.js b/client/coral-framework/store/actions/items.js index 956b70350..c292426d1 100644 --- a/client/coral-framework/store/actions/items.js +++ b/client/coral-framework/store/actions/items.js @@ -121,9 +121,15 @@ export function getStream (assetId) { comments: rootComments })) - const keys = Object.keys(childComments) - for (var i=0; i < keys.length; i++ ) { - dispatch(updateItem(keys[i], 'children', childComments[keys[i]].reverse())) + const childKeys = Object.keys(childComments) + for (var i=0; i < childKeys.length; i++ ) { + dispatch(updateItem(childKeys[i], 'children', childComments[childKeys[i]].reverse())) + } + + /* Hydrate actions on comments */ + const actions = Object.keys(json.actions) + for (var i=0; i < actions.length; i++ ) { + dispatch(updateItem(actions[i].item_id, actions[i].type, actions[i].id)) } return (json)