From c32a95a8855947963af0dc9515ee0fa21b72d892 Mon Sep 17 00:00:00 2001
From: infinite-persistence
<64950861+infinite-persistence@users.noreply.github.com>
Date: Tue, 4 May 2021 23:08:36 +0800
Subject: [PATCH] Livestream comment delete/edit fix (#5971)
* Fix ability to delete own comments in livestream
## Issue
5832: can't remove own comments in live stream mode (if you have multiple channels?)
Looks like it was just missing `commentIsMine` for the new component.
* Disable editing livestream comments
It doesn't do anything at the moment, anyways.
* Disable deleting hyperchats
The "total tipped" will get deducted when hyperchats are deleted, which doesn't make sense (doesn't reflect actual total that the creator received).
---
ui/component/commentMenuList/view.jsx | 9 +++++++--
ui/component/livestreamComment/view.jsx | 9 ++++++++-
ui/component/livestreamComments/index.js | 3 ++-
ui/component/livestreamComments/view.jsx | 15 +++++++++++++++
4 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/ui/component/commentMenuList/view.jsx b/ui/component/commentMenuList/view.jsx
index 7d7150c6c..ce279085c 100644
--- a/ui/component/commentMenuList/view.jsx
+++ b/ui/component/commentMenuList/view.jsx
@@ -23,6 +23,8 @@ type Props = {
isTopLevel: boolean,
commentModBlock: (string) => void,
playingUri: ?PlayingUri,
+ disableEdit?: boolean,
+ disableRemove?: boolean,
};
function CommentMenuList(props: Props) {
@@ -43,6 +45,8 @@ function CommentMenuList(props: Props) {
fetchComments,
commentModBlock,
playingUri,
+ disableEdit,
+ disableRemove,
} = props;
const activeChannelIsCreator = activeChannelClaim && activeChannelClaim.permanent_url === contentChannelPermanentUrl;
@@ -81,7 +85,8 @@ function CommentMenuList(props: Props) {
)}
- {activeChannelClaim &&
+ {!disableRemove &&
+ activeChannelClaim &&
(activeChannelClaim.permanent_url === authorUri ||
activeChannelClaim.permanent_url === contentChannelPermanentUrl) && (
)}
- {commentIsMine && activeChannelClaim && activeChannelClaim.permanent_url === authorUri && (
+ {commentIsMine && activeChannelClaim && activeChannelClaim.permanent_url === authorUri && !disableEdit && (