diff --git a/client/coral-embed-stream/src/CommentStream.js b/client/coral-embed-stream/src/CommentStream.js index c052e5aa1..e6cc8fbbc 100644 --- a/client/coral-embed-stream/src/CommentStream.js +++ b/client/coral-embed-stream/src/CommentStream.js @@ -61,7 +61,11 @@ class CommentStream extends Component { // Set up messaging between embedded Iframe an parent component this.pym = new Pym.Child({polling: 100}); - const path = this.pym.parentUrl.split('#')[0]; + let path = this.pym.parentUrl.split('#')[0]; + + if (!path) { + path = window.location.href.split('#')[0]; + } this.props.getStream(path || window.location); this.path = path; diff --git a/client/coral-framework/actions/user.js b/client/coral-framework/actions/user.js index 69f4882bb..0ee8659d8 100644 --- a/client/coral-framework/actions/user.js +++ b/client/coral-framework/actions/user.js @@ -32,7 +32,7 @@ export const saveBio = (user_id, formData) => dispatch => { export const fetchCommentsByUserId = userId => { return (dispatch) => { dispatch({type: actions.COMMENTS_BY_USER_REQUEST}); - return coralApi(`/comments?user_id${userId}`) + return coralApi(`/comments?user_id=${userId}`) .then(({comments, assets}) => { comments.forEach(comment => dispatch(addItem(comment, 'comments'))); diff --git a/client/coral-framework/reducers/user.js b/client/coral-framework/reducers/user.js index 6e9f3529c..bd5f78e87 100644 --- a/client/coral-framework/reducers/user.js +++ b/client/coral-framework/reducers/user.js @@ -1,4 +1,4 @@ -import {Map, fromJS} from 'immutable'; +import {Map} from 'immutable'; import * as authActions from '../constants/auth'; import * as actions from '../constants/user'; import * as assetActions from '../constants/assets'; @@ -34,9 +34,9 @@ export default function user (state = initialState, action) { return state .set('settings', action.settings); case actions.COMMENTS_BY_USER_SUCCESS: - return state.set('myComments', fromJS(action.comments)); + return state.set('myComments', action.comments); case assetActions.MULTIPLE_ASSETS_SUCCESS: - return state.set('myAssets', fromJS(action.assets)); + return state.set('myAssets', action.assets); default : return state; } diff --git a/client/coral-plugin-history/Comment.js b/client/coral-plugin-history/Comment.js index c54a0feef..37a93df13 100644 --- a/client/coral-plugin-history/Comment.js +++ b/client/coral-plugin-history/Comment.js @@ -6,7 +6,7 @@ const Comment = props => { return (
- {props.asset.url} + {`${props.asset.url}#${props.comment.id}`}
{props.comment.body}