diff --git a/static/app-strings.json b/static/app-strings.json index ec9a7c743..4f173adff 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -1445,6 +1445,7 @@ "You loved this": "You loved this", "Creator loved this": "Creator loved this", "A channel is required to throw fire and slime": "A channel is required to throw fire and slime", + "The requested comment is no longer available.": "The requested comment is no longer available.", "Best": "Best", "Controversial": "Controversial", "Show Replies": "Show Replies", diff --git a/ui/redux/actions/comments.js b/ui/redux/actions/comments.js index ff09049d7..e1686cc18 100644 --- a/ui/redux/actions/comments.js +++ b/ui/redux/actions/comments.js @@ -105,7 +105,7 @@ export function doCommentList( }; } -export function doCommentById(commentId: string) { +export function doCommentById(commentId: string, toastIfNotFound: boolean = true) { return (dispatch: Dispatch, getState: GetState) => { return Comments.comment_by_id({ comment_id: commentId, with_ancestors: true }) .then((result: CommentByIdResponse) => { @@ -122,7 +122,16 @@ export function doCommentById(commentId: string) { return result; }) .catch((error) => { - devToast(dispatch, error.message); + if (error.message === 'sql: no rows in result set' && toastIfNotFound) { + dispatch( + doToast({ + isError: true, + message: __('The requested comment is no longer available.'), + }) + ); + } else { + devToast(dispatch, error.message); + } }); }; }