diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-03-28 10:34:25 +0900 |
|---|---|---|
| committer | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-03-28 10:34:25 +0900 |
| commit | 0c14250678a955e3478f95e402d92c73c173637d (patch) | |
| tree | 4b117798a7e758745554e7c181f759ca39d10693 /packages/frontend/src | |
| parent | Bump version to 2025.3.2-beta.14 (diff) | |
| download | misskey-0c14250678a955e3478f95e402d92c73c173637d.tar.gz misskey-0c14250678a955e3478f95e402d92c73c173637d.tar.bz2 misskey-0c14250678a955e3478f95e402d92c73c173637d.zip | |
enhance(frontend): チャットが開放されていない場合のUIを改善
Diffstat (limited to 'packages/frontend/src')
| -rw-r--r-- | packages/frontend/src/pages/chat/home.home.vue | 5 | ||||
| -rw-r--r-- | packages/frontend/src/utility/get-user-menu.ts | 18 |
2 files changed, 16 insertions, 7 deletions
diff --git a/packages/frontend/src/pages/chat/home.home.vue b/packages/frontend/src/pages/chat/home.home.vue index 0affef6333..007e9fc1f4 100644 --- a/packages/frontend/src/pages/chat/home.home.vue +++ b/packages/frontend/src/pages/chat/home.home.vue @@ -5,7 +5,9 @@ SPDX-License-Identifier: AGPL-3.0-only <template> <div class="_gaps"> - <MkButton primary gradate rounded :class="$style.start" @click="start"><i class="ti ti-plus"></i> {{ i18n.ts.startChat }}</MkButton> + <MkButton v-if="$i.policies.canChat" primary gradate rounded :class="$style.start" @click="start"><i class="ti ti-plus"></i> {{ i18n.ts.startChat }}</MkButton> + + <MkInfo v-else>{{ i18n.ts._chat.chatNotAvailableForThisAccountOrServer }}</MkInfo> <MkAd :prefer="['horizontal', 'horizontal-big']"/> @@ -78,6 +80,7 @@ import * as os from '@/os.js'; import { updateCurrentAccountPartial } from '@/accounts.js'; import MkInput from '@/components/MkInput.vue'; import MkFoldableSection from '@/components/MkFoldableSection.vue'; +import MkInfo from '@/components/MkInfo.vue'; const $i = ensureSignin(); diff --git a/packages/frontend/src/utility/get-user-menu.ts b/packages/frontend/src/utility/get-user-menu.ts index 37c88c9665..105e15a20f 100644 --- a/packages/frontend/src/utility/get-user-menu.ts +++ b/packages/frontend/src/utility/get-user-menu.ts @@ -362,12 +362,18 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: Router const canonical = user.host === null ? `@${user.username}` : `@${user.username}@${user.host}`; os.post({ specified: user, initialText: `${canonical} ` }); }, - }, { - type: 'link', - icon: 'ti ti-messages', - text: i18n.ts._chat.chatWithThisUser, - to: `/chat/user/${user.id}`, - }, { type: 'divider' }, { + }); + + if ($i.policies.canChat) { + menuItems.push({ + type: 'link', + icon: 'ti ti-messages', + text: i18n.ts._chat.chatWithThisUser, + to: `/chat/user/${user.id}`, + }); + } + + menuItems.push({ type: 'divider' }, { icon: user.isMuted ? 'ti ti-eye' : 'ti ti-eye-off', text: user.isMuted ? i18n.ts.unmute : i18n.ts.mute, action: toggleMute, |