diff --git a/CHANGELOG.md b/CHANGELOG.md index ec816817c..a225fa969 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ - Deckで非ルートページにアクセスした際に簡易UIで表示しない設定を追加 - ロール設定画面でロールIDを確認できるように - コンテキストメニュー表示時のパフォーマンスを改善 +- フォロー/フォロワー非公開時の表示を改善 - Fix: サーバーメトリクスが90度傾いている - Fix: 非ログイン時にクレデンシャルが必要なページに行くとエラーが出る問題を修正 - Fix: sparkle内にリンクを入れるとクリック不能になる問題の修正 diff --git a/packages/frontend/src/components/MkUserInfo.vue b/packages/frontend/src/components/MkUserInfo.vue index 172b51751..81c9d3ec4 100644 --- a/packages/frontend/src/components/MkUserInfo.vue +++ b/packages/frontend/src/components/MkUserInfo.vue @@ -17,10 +17,10 @@

{{ i18n.ts.notes }}

{{ user.notesCount }}
-
+

{{ i18n.ts.following }}

{{ user.followingCount }}
-
+

{{ i18n.ts.followers }}

{{ user.followersCount }}
@@ -34,6 +34,7 @@ import MkFollowButton from '@/components/MkFollowButton.vue'; import { userPage } from '@/filters/user'; import { i18n } from '@/i18n'; import { $i } from '@/account'; +import { isFfVisibleForMe } from '@/scripts/isFfVisibleForMe'; defineProps<{ user: misskey.entities.UserDetailed; diff --git a/packages/frontend/src/components/MkUserPopup.vue b/packages/frontend/src/components/MkUserPopup.vue index 3b6e348e0..04331ceb5 100644 --- a/packages/frontend/src/components/MkUserPopup.vue +++ b/packages/frontend/src/components/MkUserPopup.vue @@ -30,11 +30,11 @@
{{ i18n.ts.notes }}
{{ number(user.notesCount) }}
-
+
{{ i18n.ts.following }}
{{ number(user.followingCount) }}
-
+
{{ i18n.ts.followers }}
{{ number(user.followersCount) }}
@@ -61,6 +61,7 @@ import number from '@/filters/number'; import { i18n } from '@/i18n'; import { defaultStore } from '@/store'; import { $i } from '@/account'; +import { isFfVisibleForMe } from '@/scripts/isFfVisibleForMe'; const props = defineProps<{ showing: boolean; diff --git a/packages/frontend/src/pages/user/home.vue b/packages/frontend/src/pages/user/home.vue index 23588763b..b0d42463a 100644 --- a/packages/frontend/src/pages/user/home.vue +++ b/packages/frontend/src/pages/user/home.vue @@ -100,15 +100,15 @@
- + {{ number(user.notesCount) }} {{ i18n.ts.notes }} - + {{ number(user.followingCount) }} {{ i18n.ts.following }} - + {{ number(user.followersCount) }} {{ i18n.ts.followers }} @@ -160,6 +160,7 @@ import { dateString } from '@/filters/date'; import { confetti } from '@/scripts/confetti'; import MkNotes from '@/components/MkNotes.vue'; import { api } from '@/os'; +import { isFfVisibleForMe } from '@/scripts/isFfVisibleForMe'; const XPhotos = defineAsyncComponent(() => import('./index.photos.vue')); const XActivity = defineAsyncComponent(() => import('./index.activity.vue')); diff --git a/packages/frontend/src/scripts/isFfVisibleForMe.ts b/packages/frontend/src/scripts/isFfVisibleForMe.ts new file mode 100644 index 000000000..0ddd3f377 --- /dev/null +++ b/packages/frontend/src/scripts/isFfVisibleForMe.ts @@ -0,0 +1,11 @@ +import * as misskey from 'misskey-js'; +import { $i } from '@/account'; + +export function isFfVisibleForMe(user: misskey.entities.UserDetailed): boolean { + if ($i && $i.id === user.id) return true; + + if (user.ffVisibility === 'private') return false; + if (user.ffVisibility === 'followers' && !user.isFollowing) return false; + + return true; +}