# モバイルで「未分類」が表示される

**URL:** <https://meta.discourse.org/t/uncategorized-showing-up-on-mobile/186839>\
**Category:** Bug\
**Created:** [2021 年 4 月 14 日午後 5:30 UTC](https://meta.discourse.org/t/uncategorized-showing-up-on-mobile/186839 "2021-04-14T17:30:25Z")\
**Posts on this page:** 1\
**Showing post:** 16

<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:** [2021 年 4 月 29 日午後 12:33 UTC](https://meta.discourse.org/t/uncategorized-showing-up-on-mobile/186839/16 "2021-04-29T12:33:15Z")

</div>

最初の投稿にあるバグの修正を提出しました：

> <https://github.com/discourse/discourse/pull/12889>
>
> Uncategorized was sometimes visible even if allow\_uncategorized\_topics
> was fals…e. This was especially happening on mobile, if at least one
> topic was uncategorized.

Discourse からコードを削除する最初の解決策を選択しました。もう一つの案は、未分類カテゴリに少なくとも 1 つのトピックが存在するかを判定するためにコードを追加するものでした。

また、category.uncategorized? のすべての使用箇所をレビューし、Uncategorized を「ユニコーン（特別な存在）」ではなく、より一般的なカテゴリとして扱うことで不要になる可能性のあるいくつかの箇所を見つけました：

> <https://github.com/discourse/discourse/blob/af6d0342b642feac3a5e359d13c854d2a80145b6/app/controllers/list_controller.rb#L372-L378>

> <https://github.com/discourse/discourse/blob/3e7f7fdde8dd4ad92a34352ec927b2cdfbf91416/app/serializers/basic_category_serializer.rb#L43-L57>

> <https://github.com/discourse/discourse/blob/eeaecd4fd2216f909e643554b0ee7f728944c2c4/app/models/category.rb#L898>

これらは他の機能に影響を与えない部分であり、変更のリスクを低く抑えることができますが、依然として簡単ではありません。

---

_[View the full topic](https://meta.discourse.org/t/uncategorized-showing-up-on-mobile/186839)._
