mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: remove reply after deleted
This commit is contained in:
@@ -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();
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user