opt: remove reply after deleted

This commit is contained in:
bggRGjQaUbCoE
2024-09-06 11:19:08 +08:00
parent d5fbde70fa
commit c37f6835f8
3 changed files with 61 additions and 9 deletions

View File

@@ -277,6 +277,26 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
}
});
},
onDelete: (rpid, frpid) {
frpid == null
? _videoReplyController.replyList.value =
_videoReplyController.replyList
.where(
(item) => item.rpid != rpid)
.toList()
: _videoReplyController.replyList
.map((item) {
if (item.rpid == frpid) {
return item
..replies = item.replies
?.where((reply) =>
reply.rpid != rpid)
.toList();
} else {
return item;
}
}).toList();
},
);
}
},