# チャットが無効になっている場合、チャット統計は表示されないようにする

**URL:** <https://meta.discourse.org/t/chat-statistics-should-not-be-visible-if-chat-is-disabled/249490>\
**Category:** UX\
**Tags:** chat, completed\
**Created:** [2022 年 12 月 20 日午後 3:54 UTC](https://meta.discourse.org/t/chat-statistics-should-not-be-visible-if-chat-is-disabled/249490 "2022-12-20T15:54:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)\
**Post date:** [2022 年 12 月 20 日午後 3:54 UTC](https://meta.discourse.org/t/chat-statistics-should-not-be-visible-if-chat-is-disabled/249490/1 "2022-12-20T15:54:53Z")

</div>

チャットが無効になっている場合：

 ![Screenshot 2022-12-20 at 15.53.01](https://global.discourse-cdn.com/meta/original/4X/9/0/b/90bdb05444df494fb1ad305b9ddb4b48ca030fdd.png)

`/About` ページにその統計情報を表示しないようにしていただけると、大変助かります 😊

 ![Screenshot 2022-12-20 at 15.52.52](https://global.discourse-cdn.com/meta/original/4X/0/a/4/0a4a74c0ce1b909b42527f7773811af6feee9454.png)

---

<div class="post-metadata">

**Author:** ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)\
**Post date:** [2022 年 12 月 20 日午後 7:24 UTC](https://meta.discourse.org/t/chat-statistics-should-not-be-visible-if-chat-is-disabled/249490/2 "2022-12-20T19:24:35Z")

</div>

参考までに、チャットがスタッフ専用機能として使用されている場合に、その存在やアクティビティを全員に明らかにならないように、さらにこれを拡張することもできます。👍

現在、CSSの回避策として、これを小さなテーマコンポーネントに追加しています。

```css
.about-chat_messages-count {
    display: none;
}

```

---

<div class="post-metadata">

**Author:** ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)\
**Post date:** [2022 年 12 月 20 日午後 8:54 UTC](https://meta.discourse.org/t/chat-statistics-should-not-be-visible-if-chat-is-disabled/249490/3 "2022-12-20T20:54:43Z")

</div>

素晴らしい回避策です！

 ![Screenshot 2022-12-20 at 20.54.04](https://global.discourse-cdn.com/meta/original/4X/e/e/9/ee9326bb447b15d3960215388111b410921c8c24.png)

@JammyDodger さん、ありがとうございます 😃

---

<div class="post-metadata">

**Author:** ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)\
**Post date:** [2023 年 3 月 2 日午前 4:29 UTC](https://meta.discourse.org/t/chat-statistics-should-not-be-visible-if-chat-is-disabled/249490/4 "2023-03-02T04:29:58Z")

</div>

こんにちは、@Richieさん。昨日、この問題の修正をマージしました。サイトが更新されれば、チャット統計は「About」ページに表示されなくなります（About統計はキャッシュが多いため、30分程度の遅延が発生する可能性があります）。

> <https://github.com/discourse/discourse/pull/20496>
>
> Follow up to 098ab29d4150a5a39880d59ef6cad5f6795a18fd. Since
> we just used a \`ca…ttr\_reader\` on \`About\` this was not safe
> for multisite, since some sites could have the chat plugin
> enabled and some may not. Using \`DiscoursePluginRegistry\` gets
> around this issue, and makes it so the chat stats only show
> for a site if \`chat\_enabled\` is true.

これでCSSの修正は不要になるはずです。

---

<div class="post-metadata">

**Author:** ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)\
**Post date:** [2023 年 3 月 2 日午後 1:18 UTC](https://meta.discourse.org/t/chat-statistics-should-not-be-visible-if-chat-is-disabled/249490/5 "2023-03-02T13:18:51Z")

</div>

素晴らしい仕事です、@Martin さん。本当にありがとうございます 😃

---

<div class="post-metadata">

**Author:** ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)\
**Post date:** [2023 年 3 月 6 日午前 8:00 UTC](https://meta.discourse.org/t/chat-statistics-should-not-be-visible-if-chat-is-disabled/249490/6 "2023-03-06T08:00:49Z")

</div>

このトピックは3日後に自動的に閉じられました。新しい返信はもう許可されていません。
