From 8ae15be264e54eb99c7b653464f39f28315f2f3c Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 15 Feb 2024 13:33:37 +0000 Subject: [PATCH] fix: display commit mg first line as pr title previously it was showing as undefined --- src/lib/stores/PR.ts | 6 ++++-- src/lib/stores/PRs.ts | 10 +++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/lib/stores/PR.ts b/src/lib/stores/PR.ts index f8be872..79e8699 100644 --- a/src/lib/stores/PR.ts +++ b/src/lib/stores/PR.ts @@ -87,10 +87,12 @@ export const ensurePRFull = (repo_id: string, pr_id: string) => { pr_event: event, summary: { ...full.summary, - title: + title: ( event.tagValue('name') || + event.tagValue('description') || extractPatchMessage(event.content) || - '', + '' + ).split('\n')[0], descritpion: event.tagValue('description') || '', created_at: event.created_at, comments: 0, diff --git a/src/lib/stores/PRs.ts b/src/lib/stores/PRs.ts index b179298..915ec6d 100644 --- a/src/lib/stores/PRs.ts +++ b/src/lib/stores/PRs.ts @@ -76,7 +76,12 @@ export const ensurePRSummaries = async (repo_id: string) => { ...summary_defaults, id: event.id, repo_id: repo_id, - title: extractPatchMessage(event.content) || '', + title: ( + event.tagValue('name') || + event.tagValue('description') || + extractPatchMessage(event.content) || + '' + ).split('\n')[0], descritpion: event.tagValue('description') || '', created_at: event.created_at, comments: 0, @@ -206,3 +211,6 @@ function getAndUpdatePRStatus(prs: PRSummaries, repo: Repo): void { }) }) } +function extractTagContent(arg0: string): string { + throw new Error('Function not implemented.') +}