Show the correct username

This commit is contained in:
naskya 2023-05-05 09:46:47 +09:00
parent 4124f00a34
commit ea95a9358e
3 changed files with 60 additions and 18 deletions

View file

@ -201,11 +201,27 @@
<I18n :src="softMuteReasonI18nSrc(muted.what)" tag="small">
<template #name>
<MkA
v-user-preview="appearNote.userId"
v-user-preview="
['renote', 'quote'].includes(muted.what)
? note.userId
: appearNote.userId
"
class="name"
:to="userPage(appearNote.user)"
:to="
userPage(
['renote', 'quote'].includes(muted.what)
? note.user
: appearNote.user
)
"
>
<MkUserName :user="appearNote.user" />
<MkUserName
:user="
['renote', 'quote'].includes(muted.what)
? note.user
: appearNote.user
"
/>
</MkA>
</template>
<template #reason>
@ -301,9 +317,7 @@ let appearNote = $computed(() =>
const isMyRenote = $i && $i.id === note.userId;
const showContent = ref(false);
const isDeleted = ref(false);
const muted = ref(
getWordSoftMute(appearNote, $i, defaultStore.state.mutedWords)
);
const muted = ref(getWordSoftMute(note, $i, defaultStore.state.mutedWords));
const translation = ref(null);
const translating = ref(false);
const enableEmojiReactions = defaultStore.state.enableEmojiReactions;

View file

@ -42,11 +42,27 @@
<I18n :src="softMuteReasonI18nSrc(muted.what)" tag="small">
<template #name>
<MkA
v-user-preview="appearNote.userId"
v-user-preview="
['renote', 'quote'].includes(muted.what)
? note.userId
: appearNote.userId
"
class="name"
:to="userPage(appearNote.user)"
:to="
userPage(
['renote', 'quote'].includes(muted.what)
? note.user
: appearNote.user
)
"
>
<MkUserName :user="appearNote.user" />
<MkUserName
:user="
['renote', 'quote'].includes(muted.what)
? note.user
: appearNote.user
"
/>
</MkA>
</template>
<template #reason>
@ -152,9 +168,7 @@ let appearNote = $computed(() =>
const isMyRenote = $i && $i.id === note.userId;
const showContent = ref(false);
const isDeleted = ref(false);
const muted = ref(
getWordSoftMute(appearNote, $i, defaultStore.state.mutedWords)
);
const muted = ref(getWordSoftMute(note, $i, defaultStore.state.mutedWords));
const translation = ref(null);
const translating = ref(false);
const urls = appearNote.text

View file

@ -166,11 +166,27 @@
<I18n :src="softMuteReasonI18nSrc(muted.what)" tag="small">
<template #name>
<MkA
v-user-preview="appearNote.userId"
v-user-preview="
['renote', 'quote'].includes(muted.what)
? note.userId
: appearNote.userId
"
class="name"
:to="userPage(appearNote.user)"
:to="
userPage(
['renote', 'quote'].includes(muted.what)
? note.user
: appearNote.user
)
"
>
<MkUserName :user="appearNote.user" />
<MkUserName
:user="
['renote', 'quote'].includes(muted.what)
? note.user
: appearNote.user
"
/>
</MkA>
</template>
<template #reason>
@ -252,9 +268,7 @@ let appearNote = $computed(() =>
isRenote ? (note.renote as misskey.entities.Note) : note
);
const isDeleted = ref(false);
const muted = ref(
getWordSoftMute(appearNote, $i, defaultStore.state.mutedWords)
);
const muted = ref(getWordSoftMute(note, $i, defaultStore.state.mutedWords));
const translation = ref(null);
const translating = ref(false);
const replies: misskey.entities.Note[] =