[146] resolve conversation
This commit is contained in:
parent
4389124912
commit
06e68fca4a
|
@ -97,7 +97,6 @@ export const Comment = (props: Props) => {
|
|||
return (
|
||||
<li class={clsx(styles.comment, { [styles.isNew]: !isCommentAuthor() && createdAt > props.lastSeen })}>
|
||||
<Show when={!!body()}>
|
||||
<div style={{ color: 'red' }}>{comment().id}</div>
|
||||
<div class={styles.commentContent}>
|
||||
<Show
|
||||
when={!props.compact}
|
||||
|
|
|
@ -30,7 +30,8 @@ export const CommentRatingControl = (props: Props) => {
|
|||
)
|
||||
const isUpvoted = createMemo(() => checkReaction(ReactionKind.Like))
|
||||
const isDownvoted = createMemo(() => checkReaction(ReactionKind.Dislike))
|
||||
const canVote = userSlug() !== props.comment.createdBy.slug
|
||||
const canVote = createMemo(() => userSlug() !== props.comment.createdBy.slug)
|
||||
|
||||
const shoutRatingReactions = createMemo(() =>
|
||||
Object.values(reactionEntities).filter(
|
||||
(r) =>
|
||||
|
@ -56,7 +57,6 @@ export const CommentRatingControl = (props: Props) => {
|
|||
} else if (isDownvoted()) {
|
||||
await deleteCommentReaction(ReactionKind.Dislike)
|
||||
} else {
|
||||
console.log('!!! createReaction:')
|
||||
await createReaction({
|
||||
kind: isUpvote ? ReactionKind.Like : ReactionKind.Dislike,
|
||||
shout: props.comment.shout.id,
|
||||
|
@ -72,8 +72,11 @@ export const CommentRatingControl = (props: Props) => {
|
|||
|
||||
return (
|
||||
<div class={styles.commentRating}>
|
||||
{!canVote()}
|
||||
<button
|
||||
onClick={() => canVote && handleRatingChange(true)}
|
||||
role="button"
|
||||
disabled={!canVote() || !userSlug()}
|
||||
onClick={() => handleRatingChange(true)}
|
||||
class={clsx(styles.commentRatingControl, styles.commentRatingControlUp, {
|
||||
[styles.voted]: isUpvoted()
|
||||
})}
|
||||
|
@ -102,7 +105,9 @@ export const CommentRatingControl = (props: Props) => {
|
|||
</ul>
|
||||
</Popup>
|
||||
<button
|
||||
onClick={() => canVote && handleRatingChange(false)}
|
||||
role="button"
|
||||
disabled={!canVote() || !userSlug()}
|
||||
onClick={() => handleRatingChange(false)}
|
||||
class={clsx(styles.commentRatingControl, styles.commentRatingControlDown, {
|
||||
[styles.voted]: isDownvoted()
|
||||
})}
|
||||
|
|
3
src/utils/clone.ts
Normal file
3
src/utils/clone.ts
Normal file
|
@ -0,0 +1,3 @@
|
|||
// debug nested objects console.log('message', clone(obj))
|
||||
|
||||
export const clone = <T>(obj: T) => JSON.parse(JSON.stringify(obj))
|
|
@ -1,5 +0,0 @@
|
|||
export const jsonParse = <T>(obj: T) => JSON.parse(JSON.stringify(obj))
|
||||
|
||||
export const jsonParseLog = <T>(msg: string, obj: T) => {
|
||||
console.log(`${msg}: `, JSON.parse(JSON.stringify(obj)))
|
||||
}
|
Loading…
Reference in New Issue
Block a user