Remove incorrect comments

- activeChannelClaim is the comment creator, not receiver.
- doSeeNotifications marks a notification as "seen", and not "send a notification".
- Removed comments that are just explaining the syntax.
This commit is contained in:
infinite-persistence 2022-01-07 20:00:23 +08:00
parent ac93e0c22c
commit 8507d07d3e
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0

View file

@ -549,8 +549,8 @@ export function doCommentReact(commentId: string, type: string) {
/**
*
* @param comment
* @param claim_id - File claim id
* @param parent_id - What is this?
* @param claim_id The ID of the claim to create the comment on. Can be a file, livestream, or channel page.
* @param parent_id
* @param uri
* @param livestream
* @param sticker
@ -572,8 +572,6 @@ export function doCommentCreate(
) {
return async (dispatch: Dispatch, getState: GetState) => {
const state = getState();
// get active channel that will receive comment and optional tip
const activeChannelClaim = selectActiveChannelClaim(state);
if (!activeChannelClaim) {
@ -593,7 +591,6 @@ export function doCommentCreate(
} catch (e) {}
}
// send a notification
const notification = parent_id && makeSelectNotificationForCommentId(parent_id)(state);
if (notification && !notification.is_seen) dispatch(doSeeNotifications([notification.id]));
@ -601,8 +598,6 @@ export function doCommentCreate(
return dispatch(doToast({ isError: true, message: __('Unable to verify your channel. Please try again.') }));
}
// Comments is a function which helps make calls to the backend
// these params passed in POST call.
return Comments.comment_create({
comment: comment,
claim_id: claim_id,
@ -612,9 +607,9 @@ export function doCommentCreate(
signature: signatureData.signature,
signing_ts: signatureData.signing_ts,
sticker: sticker,
...(txid ? { support_tx_id: txid } : {}), // add transaction id if it exists
...(payment_intent_id ? { payment_intent_id } : {}), // add payment_intent_id if it exists
...(environment ? { environment } : {}), // add environment for stripe if it exists
...(txid ? { support_tx_id: txid } : {}),
...(payment_intent_id ? { payment_intent_id } : {}),
...(environment ? { environment } : {}),
})
.then((result: CommentCreateResponse) => {
dispatch({