Merge branch 'develop' into feature/2024.10
This commit is contained in:
commit
6c13dc04f2
26 changed files with 849 additions and 366 deletions
|
|
@ -71,6 +71,14 @@ type PackedQuote =
|
|||
fileIds: NonNullable<Packed<'Note'>['fileIds']>
|
||||
});
|
||||
|
||||
type PackedPureRenote = PackedRenote & {
|
||||
text: NonNullable<Packed<'Note'>['text']>;
|
||||
cw: NonNullable<Packed<'Note'>['cw']>;
|
||||
replyId: NonNullable<Packed<'Note'>['replyId']>;
|
||||
poll: NonNullable<Packed<'Note'>['poll']>;
|
||||
fileIds: NonNullable<Packed<'Note'>['fileIds']>;
|
||||
}
|
||||
|
||||
export function isRenotePacked(note: Packed<'Note'>): note is PackedRenote {
|
||||
return note.renoteId != null;
|
||||
}
|
||||
|
|
@ -82,3 +90,7 @@ export function isQuotePacked(note: PackedRenote): note is PackedQuote {
|
|||
note.poll != null ||
|
||||
(note.fileIds != null && note.fileIds.length > 0);
|
||||
}
|
||||
|
||||
export function isPackedPureRenote(note: Packed<'Note'>): note is PackedPureRenote {
|
||||
return isRenotePacked(note) && !isQuotePacked(note);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue