Fix reply visibility errors

This commit is contained in:
Laura Hausmann 2023-07-23 12:57:53 +02:00
parent 822898236b
commit 37aaeb8093
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
2 changed files with 37 additions and 1 deletions

View file

@ -246,7 +246,7 @@ export const NoteRepository = db.getRepository(Note).extend({
...(opts.detail
? {
reply: note.replyId
? this.pack(note.reply || note.replyId, me, {
? this.tryPack(note.reply || note.replyId, me, {
detail: false,
_hint_: options?._hint_,
})
@ -283,6 +283,24 @@ export const NoteRepository = db.getRepository(Note).extend({
return packed;
},
async tryPack(
src: Note["id"] | Note,
me?: { id: User["id"] } | null | undefined,
options?: {
detail?: boolean;
_hint_?: {
myReactions: Map<Note["id"], NoteReaction | null>;
};
},
): Promise<Packed<"Note"> | undefined> {
try {
return await this.pack(src, me, options);
}
catch {
return undefined;
}
},
async packMany(
notes: Note[],
me?: { id: User["id"] } | null | undefined,

View file

@ -25,6 +25,15 @@
>
<i class="ph-arrow-bend-left-up ph-bold ph-lg"></i>
</MkA>
<MkA
v-else-if="note.replyId && !note.reply"
behavior="browser"
v-tooltip="i18n.ts.jumpToPrevious"
class="reply-icon"
@click.stop
>
<i class="ph-arrow-bend-left-up ph-bold ph-lg"></i>
</MkA>
<Mfm
v-if="note.cw != ''"
class="text"
@ -97,6 +106,15 @@
>
<i class="ph-arrow-bend-left-up ph-bold ph-lg"></i>
</MkA>
<MkA
v-else-if="note.replyId && !note.reply"
behavior="browser"
v-tooltip="i18n.ts.jumpToPrevious"
class="reply-icon"
@click.stop
>
<i class="ph-arrow-bend-left-up ph-bold ph-lg"></i>
</MkA>
</template>
<Mfm
v-if="note.text"