mirror of
https://github.com/wassname/talk.git
synced 2026-07-20 12:40:47 +08:00
Merge pull request #958 from coralproject/detect-n-display-stream-errors
Detect and display stream errors
This commit is contained in:
@@ -201,7 +201,7 @@ class Stream extends React.Component {
|
||||
data,
|
||||
root,
|
||||
appendItemArray,
|
||||
root: {asset, asset: {comment: highlightedComment, comments}},
|
||||
root: {asset, asset: {comment: highlightedComment}},
|
||||
postComment,
|
||||
notify,
|
||||
updateItem,
|
||||
@@ -222,9 +222,8 @@ class Stream extends React.Component {
|
||||
const slotProps = {data};
|
||||
const slotQueryData = {root, asset};
|
||||
|
||||
if (!highlightedComment && !comments) {
|
||||
console.error('Talk: No comments came back from the graph given that query. Please, check the query params.');
|
||||
return <StreamError />;
|
||||
if (highlightedComment === null) {
|
||||
return <StreamError>{t('stream.comment_not_found')}</StreamError>;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import React from 'react';
|
||||
import styles from './StreamError.css';
|
||||
import t from 'coral-framework/services/i18n';
|
||||
|
||||
export const StreamError = () => (
|
||||
export const StreamError = ({children}) => (
|
||||
<div className={styles.streamError}>
|
||||
{t('common.error')}
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -178,7 +178,7 @@ class StreamContainer extends React.Component {
|
||||
|
||||
render() {
|
||||
if (!this.props.root.asset
|
||||
|| !this.props.root.asset.comment
|
||||
|| this.props.root.asset.comment === undefined
|
||||
&& !this.props.root.asset.comments
|
||||
) {
|
||||
return <Spinner />;
|
||||
|
||||
@@ -323,6 +323,7 @@ en:
|
||||
user_no_comment: "You've never left a comment. Join the conversation!"
|
||||
stream:
|
||||
temporarily_suspended: "In accordance with {0}'s community guidelines, your account has been temporarily suspended. Please rejoin the conversation {1}."
|
||||
comment_not_found: "Comment was not found"
|
||||
step_1_header: "Report an issue"
|
||||
step_2_header: "Help us understand"
|
||||
step_3_header: "Thank you for your input"
|
||||
|
||||
@@ -349,6 +349,7 @@ es:
|
||||
step_3_header: "Gracias por tu participación"
|
||||
stream:
|
||||
temporarily_suspended: "De acuerdo con la guía de la comunidad de {0}, su cuenta ha sido temporalmente suspendida. Por favor unirse a la conversación {1}."
|
||||
comment_not_found: "Comentario no encontrado"
|
||||
streams:
|
||||
all: "Todos"
|
||||
article: "Artículo"
|
||||
|
||||
Reference in New Issue
Block a user