File size: 652 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import { getStateKey } from 'calypso/state/comments/utils';
import 'calypso/state/comments/init';
/**
* Returns the active reply comment for a given site and post.
* @param {Object} options options object.
* @param {Object} options.state Global state tree
* @param {number} options.siteId The ID of the site we're querying
* @param {number} options.postId The ID of the post we're querying
* @returns {number|string} commentId Can be a string if the comment is a placeholder
*/
export function getActiveReplyCommentId( { state, siteId, postId } ) {
return state.comments.activeReplies[ getStateKey( siteId, postId ) ] ?? null;
}
|