From 9bf5dc67f57d4272a91fef329854d0dc5c8c7245 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 29 Nov 2020 11:25:43 +0900 Subject: wip --- src/client/scripts/get-user-menu.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/client/scripts') diff --git a/src/client/scripts/get-user-menu.ts b/src/client/scripts/get-user-menu.ts index c3de7313cc..a97fed9919 100644 --- a/src/client/scripts/get-user-menu.ts +++ b/src/client/scripts/get-user-menu.ts @@ -7,9 +7,10 @@ import getAcct from '../../misc/acct/render'; import * as os from '@/os'; import { store, userActions } from '@/store'; import { router } from '@/router'; -import { popout } from './popout'; export function getUserMenu(user) { + const meId = store.getters.isSignedIn ? store.state.i.id : null; + async function pushList() { const t = i18n.global.t('selectList'); // なぜか後で参照すると null になるので最初にメモリに確保しておく const lists = await os.api('users/lists/list'); @@ -130,7 +131,7 @@ export function getUserMenu(user) { action: () => { os.post({ specified: user }); } - }, store.state.i.id != user.id ? { + }, meId != user.id ? { type: 'link', icon: faComments, text: i18n.global.t('startMessaging'), @@ -139,13 +140,13 @@ export function getUserMenu(user) { icon: faListUl, text: i18n.global.t('addToList'), action: pushList - }, store.state.i.id != user.id ? { + }, meId != user.id ? { icon: faUsers, text: i18n.global.t('inviteToGroup'), action: inviteGroup } : undefined] as any; - if (store.getters.isSignedIn && store.state.i.id != user.id) { + if (store.getters.isSignedIn && meId != user.id) { menu = menu.concat([null, { icon: user.isMuted ? faEye : faEyeSlash, text: user.isMuted ? i18n.global.t('unmute') : i18n.global.t('mute'), @@ -175,7 +176,7 @@ export function getUserMenu(user) { } } - if (store.getters.isSignedIn && store.state.i.id === user.id) { + if (store.getters.isSignedIn && meId === user.id) { menu = menu.concat([null, { icon: faPencilAlt, text: i18n.global.t('editProfile'), -- cgit v1.2.3-freya