fix: Hide unmute option when the user is blocked
This commit is contained in:
parent
135860cc68
commit
569136b87c
|
@ -26,7 +26,7 @@
|
||||||
<span>{{ item.text }}</span>
|
<span>{{ item.text }}</span>
|
||||||
<span v-if="item.indicate" class="indicator"><i class="ph-circle-fill"></i></span>
|
<span v-if="item.indicate" class="indicator"><i class="ph-circle-fill"></i></span>
|
||||||
</a>
|
</a>
|
||||||
<button v-else-if="item.type === 'user'" :tabindex="i" class="_button item" :class="{ active: item.active }" :disabled="item.active" @click="clicked(item.action, $event)" @mouseenter.passive="onItemMouseEnter(item)" @mouseleave.passive="onItemMouseLeave(item)">
|
<button v-else-if="item.type === 'user' && !items.hidden" :tabindex="i" class="_button item" :class="{ active: item.active }" :disabled="item.active" @click="clicked(item.action, $event)" @mouseenter.passive="onItemMouseEnter(item)" @mouseleave.passive="onItemMouseLeave(item)">
|
||||||
<MkAvatar :user="item.user" class="avatar"/><MkUserName :user="item.user"/>
|
<MkAvatar :user="item.user" class="avatar"/><MkUserName :user="item.user"/>
|
||||||
<span v-if="item.indicate" class="indicator"><i class="ph-circle-fill"></i></span>
|
<span v-if="item.indicate" class="indicator"><i class="ph-circle-fill"></i></span>
|
||||||
</button>
|
</button>
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
<span>{{ item.text }}</span>
|
<span>{{ item.text }}</span>
|
||||||
<span class="caret"><i class="ph-caret-right-bold ph-lg ph-fw ph-lg"></i></span>
|
<span class="caret"><i class="ph-caret-right-bold ph-lg ph-fw ph-lg"></i></span>
|
||||||
</button>
|
</button>
|
||||||
<button v-else :tabindex="i" class="_button item" :class="{ danger: item.danger, active: item.active }" :disabled="item.active" @click="clicked(item.action, $event)" @mouseenter.passive="onItemMouseEnter(item)" @mouseleave.passive="onItemMouseLeave(item)">
|
<button v-else-if="!item.hidden" :tabindex="i" class="_button item" :class="{ danger: item.danger, active: item.active }" :disabled="item.active" @click="clicked(item.action, $event)" @mouseenter.passive="onItemMouseEnter(item)" @mouseleave.passive="onItemMouseLeave(item)">
|
||||||
<i v-if="item.icon" class="ph-fw ph-lg" :class="item.icon"></i>
|
<i v-if="item.icon" class="ph-fw ph-lg" :class="item.icon"></i>
|
||||||
<MkAvatar v-if="item.avatar" :user="item.avatar" class="avatar"/>
|
<MkAvatar v-if="item.avatar" :user="item.avatar" class="avatar"/>
|
||||||
<span>{{ item.text }}</span>
|
<span>{{ item.text }}</span>
|
||||||
|
|
|
@ -261,6 +261,7 @@ export function getUserMenu(user, router: Router = mainRouter) {
|
||||||
{
|
{
|
||||||
icon: user.isMuted ? "ph-eye-bold ph-lg" : "ph-eye-slash-bold ph-lg",
|
icon: user.isMuted ? "ph-eye-bold ph-lg" : "ph-eye-slash-bold ph-lg",
|
||||||
text: user.isMuted ? i18n.ts.unmute : i18n.ts.mute,
|
text: user.isMuted ? i18n.ts.unmute : i18n.ts.mute,
|
||||||
|
hidden: user.isBlocking === true,
|
||||||
action: toggleMute,
|
action: toggleMute,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,6 +28,7 @@ export type MenuUser = {
|
||||||
user: Misskey.entities.User;
|
user: Misskey.entities.User;
|
||||||
active?: boolean;
|
active?: boolean;
|
||||||
indicate?: boolean;
|
indicate?: boolean;
|
||||||
|
hidden?: boolean;
|
||||||
action: MenuAction;
|
action: MenuAction;
|
||||||
};
|
};
|
||||||
export type MenuSwitch = {
|
export type MenuSwitch = {
|
||||||
|
@ -43,6 +44,7 @@ export type MenuButton = {
|
||||||
indicate?: boolean;
|
indicate?: boolean;
|
||||||
danger?: boolean;
|
danger?: boolean;
|
||||||
active?: boolean;
|
active?: boolean;
|
||||||
|
hidden?: boolean;
|
||||||
avatar?: Misskey.entities.User;
|
avatar?: Misskey.entities.User;
|
||||||
action: MenuAction;
|
action: MenuAction;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue