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 comment
* @param claim_id - File claim id * @param claim_id The ID of the claim to create the comment on. Can be a file, livestream, or channel page.
* @param parent_id - What is this? * @param parent_id
* @param uri * @param uri
* @param livestream * @param livestream
* @param sticker * @param sticker
@ -572,8 +572,6 @@ export function doCommentCreate(
) { ) {
return async (dispatch: Dispatch, getState: GetState) => { return async (dispatch: Dispatch, getState: GetState) => {
const state = getState(); const state = getState();
// get active channel that will receive comment and optional tip
const activeChannelClaim = selectActiveChannelClaim(state); const activeChannelClaim = selectActiveChannelClaim(state);
if (!activeChannelClaim) { if (!activeChannelClaim) {
@ -593,7 +591,6 @@ export function doCommentCreate(
} catch (e) {} } catch (e) {}
} }
// send a notification
const notification = parent_id && makeSelectNotificationForCommentId(parent_id)(state); const notification = parent_id && makeSelectNotificationForCommentId(parent_id)(state);
if (notification && !notification.is_seen) dispatch(doSeeNotifications([notification.id])); 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.') })); 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({ return Comments.comment_create({
comment: comment, comment: comment,
claim_id: claim_id, claim_id: claim_id,
@ -612,9 +607,9 @@ export function doCommentCreate(
signature: signatureData.signature, signature: signatureData.signature,
signing_ts: signatureData.signing_ts, signing_ts: signatureData.signing_ts,
sticker: sticker, sticker: sticker,
...(txid ? { support_tx_id: txid } : {}), // add transaction id if it exists ...(txid ? { support_tx_id: txid } : {}),
...(payment_intent_id ? { payment_intent_id } : {}), // add payment_intent_id if it exists ...(payment_intent_id ? { payment_intent_id } : {}),
...(environment ? { environment } : {}), // add environment for stripe if it exists ...(environment ? { environment } : {}),
}) })
.then((result: CommentCreateResponse) => { .then((result: CommentCreateResponse) => {
dispatch({ dispatch({