@@ -20,10 +20,10 @@ import {
20
20
useComments ,
21
21
} from '../../../apis/comment'
22
22
import {
23
- MAX_COMMENT_LENGTH ,
24
23
AUTHOR_MAX_COMMENT_LENGTH ,
25
24
CommentInfo ,
26
25
CommentRating ,
26
+ MAX_COMMENT_LENGTH ,
27
27
MainCommentInfo ,
28
28
SubCommentInfo ,
29
29
isMainComment ,
@@ -66,9 +66,15 @@ export const CommentArea = withSuspensable(function ViewerComments({
66
66
const auth = useAtomValue ( authAtom )
67
67
const operation = useOperation ( { id : operationId } ) . data
68
68
69
- const operationOwned = operation && auth . userId && operation . uploaderId === auth . userId
69
+ const operationOwned = ! ! (
70
+ operation &&
71
+ auth . userId &&
72
+ operation . uploaderId === auth . userId
73
+ )
70
74
71
- const maxLength = operationOwned ? AUTHOR_MAX_COMMENT_LENGTH : MAX_COMMENT_LENGTH
75
+ const maxLength = operationOwned
76
+ ? AUTHOR_MAX_COMMENT_LENGTH
77
+ : MAX_COMMENT_LENGTH
72
78
73
79
const [ replyTo , setReplyTo ] = useState < CommentInfo > ( )
74
80
@@ -112,8 +118,8 @@ export const CommentArea = withSuspensable(function ViewerComments({
112
118
sub . fromCommentId === comment . commentId
113
119
? undefined
114
120
: find ( comment . subCommentsInfos , {
115
- commentId : sub . fromCommentId ,
116
- } )
121
+ commentId : sub . fromCommentId ,
122
+ } )
117
123
}
118
124
/>
119
125
) ) }
@@ -266,7 +272,9 @@ const CommentActions = ({
266
272
const [ { userId } ] = useAtom ( authAtom )
267
273
const { operationOwned, replyTo, setReplyTo, reload } =
268
274
useContext ( CommentAreaContext )
269
- const maxLength = operationOwned ? AUTHOR_MAX_COMMENT_LENGTH : MAX_COMMENT_LENGTH
275
+ const maxLength = operationOwned
276
+ ? AUTHOR_MAX_COMMENT_LENGTH
277
+ : MAX_COMMENT_LENGTH
270
278
271
279
const [ deleteDialogOpen , setDeleteDialogOpen ] = useState ( false )
272
280
const [ pending , setPending ] = useState ( false )
@@ -337,7 +345,9 @@ const CommentActions = ({
337
345
</ p >
338
346
</ Alert >
339
347
</ div >
340
- { replyTo === comment && < CommentForm inputAutoFocus className = "mt-4" maxLength = { maxLength } /> }
348
+ { replyTo === comment && (
349
+ < CommentForm inputAutoFocus className = "mt-4" maxLength = { maxLength } />
350
+ ) }
341
351
</ div >
342
352
)
343
353
}
0 commit comments