mirror of
https://github.com/docmost/docmost.git
synced 2025-11-17 07:31:10 +10:00
fix comment replies
This commit is contained in:
@ -41,11 +41,16 @@ function CommentListWithTabs() {
|
||||
const spaceRules = space?.membership?.permissions;
|
||||
const spaceAbility = useSpaceAbility(spaceRules);
|
||||
|
||||
|
||||
const canComment: boolean = spaceAbility.can(
|
||||
SpaceCaslAction.Manage,
|
||||
SpaceCaslSubject.Page
|
||||
);
|
||||
|
||||
console.log(spaceAbility)
|
||||
|
||||
console.log('can comment', canComment);
|
||||
|
||||
// Separate active and resolved comments
|
||||
const { activeComments, resolvedComments } = useMemo(() => {
|
||||
if (!comments?.items) {
|
||||
@ -179,6 +184,17 @@ function CommentListWithTabs() {
|
||||
userSpaceRole={space?.membership?.role}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{canComment && (
|
||||
<>
|
||||
<Divider my={4} />
|
||||
<CommentEditorWithActions
|
||||
commentId={comment.id}
|
||||
onSave={handleAddReply}
|
||||
isLoading={isLoading}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</Paper>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user