OwnComment Page: deleting comment shows failure despite successful

## Change
Due to "Own Comments" being implemented the same way as "Discussion Page", the comment lookup did not work for the abandoning case.

Just skip the local cleanup of `byId` -- it doesn't matter, as the GUI uses `selectCommentsForUri` to grab the per-channel comments, so it would still disappear in the GUI immediately.
This commit is contained in:
infinite-persistence 2022-04-09 00:32:44 +08:00 committed by Thomas Zarebczan
parent 12a59708e4
commit 4b93be049c

View file

@ -575,12 +575,15 @@ export default handleActions(
// to remove the comment and its references
const claimId = comment.claim_id;
for (let i = 0; i < byId[claimId].length; i++) {
if (byId[claimId][i] === comment_id) {
// immutable update
byId[claimId] = Array.from(byId[claimId]);
byId[claimId].splice(i, 1);
break;
if (byId[claimId]) {
for (let i = 0; i < byId[claimId].length; i++) {
if (byId[claimId][i] === comment_id) {
// immutable update
byId[claimId] = Array.from(byId[claimId]);
byId[claimId].splice(i, 1);
break;
}
}
}