# 点赞按钮在已存档主题上不起作用

**URL:** https://meta.discourse.org/t/like-button-does-not-work-on-archived-topics/233822
**Category:** Bug
**Tags:** reactions
**Created:** [2022年七月24日 23:10 UTC](https://meta.discourse.org/t/like-button-does-not-work-on-archived-topics/233822 "2022-07-24T23:10:33Z")
**Posts on this page:** 5
**Page:** 2

<div class="post-metadata">

### Author: ![darkpixlz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/darkpixlz/32/549896_2.png) [@darkpixlz](https://meta.discourse.org/u/darkpixlz)
#### Post date: [2022年七月25日 01:12 UTC](https://meta.discourse.org/t/like-button-does-not-work-on-archived-topics/233822/25 "2022-07-25T01:12:47Z")

</div>

奇怪，悬停时我没有得到反应选择器。

 ![image](https://global.discourse-cdn.com/meta/original/4X/0/a/5/0a5c33e9ff8788dd7cf66b4041038f1900088b31.png)

另外，禁用点赞是 Discourse 的预期行为吗？如果是的话，我将直接在 reactions 插件上创建一个 PR 来禁用它。

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2022年七月25日 01:48 UTC](https://meta.discourse.org/t/like-button-does-not-work-on-archived-topics/233822/26 "2022-07-25T01:48:53Z")

</div>

我刚刚在内部分配了这项任务，以防它对您来说过于复杂，但我希望我们能为“已存档”和“已删除”的主题/帖子显示点赞按钮。

当任何人点击它时，我们应该告知他们“他们无法点赞帖子，因为它已被删除”——而不是含糊不清的错误消息。

但对于您自己的帖子，仍然应该隐藏该按钮。

您可以随意尝试提交 2 个 PR（一个核心，一个用于反应），但如果太难，请放心，我们会处理的。

---

<div class="post-metadata">

### Author: ![darkpixlz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/darkpixlz/32/549896_2.png) [@darkpixlz](https://meta.discourse.org/u/darkpixlz)
#### Post date: [2022年七月25日 03:36 UTC](https://meta.discourse.org/t/like-button-does-not-work-on-archived-topics/233822/28 "2022-07-25T03:36:28Z")

</div>

好的，感谢您的支持。我现在回来了，会尝试一下，如果我能找到正确的文件的话 lol

我不知道点赞在哪里，抱歉一直问

我找了一会儿，但没找到处理点赞的文件，除非有人有答案，否则我只能等团队来处理了。不过还是谢谢您的帮助 🙂

---

<div class="post-metadata">

### Author: ![nbianca](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nbianca/32/157984_2.png) [@nbianca](https://meta.discourse.org/u/nbianca)
#### Post date: [2022年八月22日 13:07 UTC](https://meta.discourse.org/t/like-button-does-not-work-on-archived-topics/233822/29 "2022-08-22T13:07:18Z")

</div>

我通过这两个 PR 改进了 discourse-reactions 对已归档主题的处理，使其更像常规的点赞按钮：

> <https://github.com/discourse/discourse/pull/17951>
>
> The like button was sometimes hidden in archived topics and that was confusing u…ser experience. This PR includes multiple commits, each one containing a different improvement.
> 
> The first change is to no longer allow users to remove their likes from archived topics. They were able to remove it, but not add it back.
> 
> The second change was to show the like button even if the topic is archived. The like button was hidden if for post that had no likes. It was confusing to not see the button and it broke discourse-reactions plugin too.

> <https://github.com/discourse/discourse-reactions/pull/176>
>
> The logic for showing the not-allowed cursor did not cover the edge
> case when t…he user has not reacted yet, but they cannot either because
> the topic does not allow.
> 
> This is related to https://github.com/discourse/discourse/pull/17951.

现在这应该不再是问题了。

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2022年八月23日 04:43 UTC](https://meta.discourse.org/t/like-button-does-not-work-on-archived-topics/233822/30 "2022-08-23T04:43:34Z")

</div>



[上一頁](https://meta.discourse.org/t/like-button-does-not-work-on-archived-topics/233822.md?page=1)
