forked from farhoodlabs/paperclip
fix(ui): harden issue comment editor sync
This commit is contained in:
@@ -102,6 +102,14 @@ export function flattenIssueCommentPages(
|
||||
return sortIssueComments((pages ?? []).flatMap((page) => page));
|
||||
}
|
||||
|
||||
export function getNextIssueCommentPageParam(
|
||||
lastPage: ReadonlyArray<IssueComment> | undefined,
|
||||
pageSize: number,
|
||||
): string | undefined {
|
||||
if (!lastPage || lastPage.length < pageSize) return undefined;
|
||||
return lastPage[lastPage.length - 1]?.id;
|
||||
}
|
||||
|
||||
export function upsertIssueComment(
|
||||
comments: IssueComment[] | undefined,
|
||||
nextComment: IssueComment,
|
||||
|
||||
Reference in New Issue
Block a user