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 ...(opts.detail
? { ? {
reply: note.replyId reply: note.replyId
? this.pack(note.reply || note.replyId, me, { ? this.tryPack(note.reply || note.replyId, me, {
detail: false, detail: false,
_hint_: options?._hint_, _hint_: options?._hint_,
}) })
@ -283,6 +283,24 @@ export const NoteRepository = db.getRepository(Note).extend({
return packed; 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( async packMany(
notes: Note[], notes: Note[],
me?: { id: User["id"] } | null | undefined, me?: { id: User["id"] } | null | undefined,

View File

@ -25,6 +25,15 @@
> >
<i class="ph-arrow-bend-left-up ph-bold ph-lg"></i> <i class="ph-arrow-bend-left-up ph-bold ph-lg"></i>
</MkA> </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 <Mfm
v-if="note.cw != ''" v-if="note.cw != ''"
class="text" class="text"
@ -97,6 +106,15 @@
> >
<i class="ph-arrow-bend-left-up ph-bold ph-lg"></i> <i class="ph-arrow-bend-left-up ph-bold ph-lg"></i>
</MkA> </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> </template>
<Mfm <Mfm
v-if="note.text" v-if="note.text"