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.
This commit is contained in:
infinite-persistence 2021-08-30 14:12:12 +08:00
parent 90c469454a
commit ebfd648a88
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0

View file

@ -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,