weixin_39847728
weixin_39847728
2021-01-09 07:52

close comments

How can I close comments for a page?

When comments are closed, I would like to see existing comments, but block new ones.

该提问来源于开源项目:utterance/utterances

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

6条回答

  • weixin_39648297 weixin_39648297 4月前

    Lock the issue to disable new comments

    点赞 评论 复制链接分享
  • weixin_39847728 weixin_39847728 4月前

    Thank you! Hadn't thought of that. Does the utterance.es widget reflect that the issue is closed?

    点赞 评论 复制链接分享
  • weixin_39648297 weixin_39648297 4月前

    It does not indicate whether the associated issue is open/closed

    点赞 评论 复制链接分享
  • weixin_39847728 weixin_39847728 4月前

    I would like to help to add this feature.

    Proposed functionality:

    1. When an issue is not locked, comments work as before.
    2. When an issue is locked, we show existing comments, but hide the possibility to add one.

    I had a look at the code, and it seems this should already work:

    • the Issue interface in github.ts:328 contains a boolean locked.
    • this field is tested in utterance.ts:51 to bail out after renderComments (if any) and before enableReactions (if the user is authenticated) if the issue is locked.

    What am I missing here?

    点赞 评论 复制链接分享
  • weixin_39847728 weixin_39847728 4月前

    Thanks. Works like a charm.

    It may have worked before too, because I found out "closing" an issue is not the same as "locking" it. The issue must be locked to close utterance's comments.

    点赞 评论 复制链接分享
  • weixin_39648297 weixin_39648297 4月前

    Nice- I was trying to match GitHubs behavior where closed issues could still be commented on. Thanks for raising the issue with reactions

    点赞 评论 复制链接分享

相关推荐