diff --git a/client/coral-admin/src/routes/Moderation/components/Comment.js b/client/coral-admin/src/routes/Moderation/components/Comment.js index 3c5e535b2..26543be6e 100644 --- a/client/coral-admin/src/routes/Moderation/components/Comment.js +++ b/client/coral-admin/src/routes/Moderation/components/Comment.js @@ -168,7 +168,7 @@ class Comment extends React.Component { {' '} {t('comment.view_context')} diff --git a/client/coral-embed-stream/src/components/Stream.js b/client/coral-embed-stream/src/components/Stream.js index 0245466a5..0cfaf0368 100644 --- a/client/coral-embed-stream/src/components/Stream.js +++ b/client/coral-embed-stream/src/components/Stream.js @@ -1,5 +1,6 @@ import React, {PropTypes} from 'react'; import LoadMore from './LoadMore'; +import {StreamError} from './StreamError'; import Comment from '../components/Comment'; import SuspendedAccount from './SuspendedAccount'; import Slot from 'coral-framework/components/Slot'; @@ -187,6 +188,12 @@ class Stream extends React.Component { }; const showCommentBox = loggedIn && ((!banned && !temporarilySuspended && !highlightedComment) || keepCommentBox); + + if (!comment && !comments) { + console.error('Talk: No comments came back from the graph given that query. Please, check the query params.'); + return ; + } + return (
diff --git a/client/coral-embed-stream/src/components/StreamError.css b/client/coral-embed-stream/src/components/StreamError.css new file mode 100644 index 000000000..908d963c0 --- /dev/null +++ b/client/coral-embed-stream/src/components/StreamError.css @@ -0,0 +1,3 @@ +.streamError { + padding: 10px 0; +} \ No newline at end of file diff --git a/client/coral-embed-stream/src/components/StreamError.js b/client/coral-embed-stream/src/components/StreamError.js new file mode 100644 index 000000000..2e8b8ff96 --- /dev/null +++ b/client/coral-embed-stream/src/components/StreamError.js @@ -0,0 +1,9 @@ +import React from 'react'; +import styles from './StreamError.css'; +import t from 'coral-framework/services/i18n'; + +export const StreamError = () => ( +
+ {t('common.error')} +
+); diff --git a/client/coral-embed/src/index.js b/client/coral-embed/src/index.js index 82eea8ef7..702308c3a 100644 --- a/client/coral-embed/src/index.js +++ b/client/coral-embed/src/index.js @@ -1,4 +1,5 @@ import pym from 'pym.js'; +import URLSearchParams from 'url-search-params'; import {stringify} from 'querystring'; @@ -190,7 +191,10 @@ Talk.render = function(el, opts) { // Compose the query to send down to the Talk API so it knows what to load. let query = {}; - query.comment_id = window.location.hash.slice(1); + let urlParams = new URLSearchParams(window.location.search); + + query.comment_id = urlParams.get('commentId'); + query.asset_id = opts.asset_id; query.asset_url = opts.asset_url; diff --git a/client/coral-plugin-flags/index.js b/client/coral-plugin-flags/index.js index d896d34f5..dd851b094 100644 --- a/client/coral-plugin-flags/index.js +++ b/client/coral-plugin-flags/index.js @@ -1 +1 @@ -export {default as FlagComment} from './components/FlagComment'; \ No newline at end of file +export {default as FlagComment} from './components/FlagComment'; diff --git a/client/coral-plugin-history/Comment.js b/client/coral-plugin-history/Comment.js index 888989737..048f0592b 100644 --- a/client/coral-plugin-history/Comment.js +++ b/client/coral-plugin-history/Comment.js @@ -29,7 +29,7 @@ const Comment = (props) => {