From ebfd648a88c0a9ad6e81a03b2c3812dce8aa288b Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Mon, 30 Aug 2021 14:12:12 +0800 Subject: [PATCH] Fix "linked-comment not found" msg not appearing ## Issue 6914 "Linked comment not found" message is gone ## Notes Commentron updated the message, so the string comparison failed. --- ui/redux/actions/comments.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/redux/actions/comments.js b/ui/redux/actions/comments.js index 894e751c9..a1ce7d175 100644 --- a/ui/redux/actions/comments.js +++ b/ui/redux/actions/comments.js @@ -160,7 +160,8 @@ export function doCommentById(commentId: string, toastIfNotFound: boolean = true return result; }) .catch((error) => { - if (error.message === 'sql: no rows in result set' && toastIfNotFound) { + const ID_NOT_FOUND_REGEX = /^comment for id (.*) could not be found$/; + if (ID_NOT_FOUND_REGEX.test(error.message) && toastIfNotFound) { dispatch( doToast({ isError: true,