Discourse Reactions 不支持非常规免费图标(对喜欢图标添加了 far- 前缀)

图标在无法点赞时可以正常工作,但在可以点赞时却不行。

查看代码,当你已点赞时:

https://github.com/discourse/discourse-reactions/blob/main/assets/javascripts/discourse/widgets/discourse-reactions-reaction-button.js#L107-L115

当你尚未点赞时:

https://github.com/discourse/discourse-reactions/blob/main/assets/javascripts/discourse/widgets/discourse-reactions-reaction-button.js#L130-L136

它期望一个 far— 版本,但 beer 似乎不存在。 :thinking:

一个快速的解决方案是使用 API 替换 far-beer,例如:

<script type="text/discourse-plugin" version="0.8">
    api.replaceIcon("far-beer", "beer");
</script>

我不知道是否应该在这里引入一个新设置,或者添加一些逻辑来使用相同的非-far 版本(如果 far 版本不存在)。 :thinking:

5 个赞