Browse Source

fix: display commit mg first line as pr title

previously it was showing as undefined
master
DanConwayDev 2 years ago
parent
commit
8ae15be264
No known key found for this signature in database
GPG Key ID: 68E15486D73F75E1
  1. 6
      src/lib/stores/PR.ts
  2. 10
      src/lib/stores/PRs.ts

6
src/lib/stores/PR.ts

@ -87,10 +87,12 @@ export const ensurePRFull = (repo_id: string, pr_id: string) => {
pr_event: event, pr_event: event,
summary: { summary: {
...full.summary, ...full.summary,
title: title: (
event.tagValue('name') || event.tagValue('name') ||
event.tagValue('description') ||
extractPatchMessage(event.content) || extractPatchMessage(event.content) ||
'', ''
).split('\n')[0],
descritpion: event.tagValue('description') || '', descritpion: event.tagValue('description') || '',
created_at: event.created_at, created_at: event.created_at,
comments: 0, comments: 0,

10
src/lib/stores/PRs.ts

@ -76,7 +76,12 @@ export const ensurePRSummaries = async (repo_id: string) => {
...summary_defaults, ...summary_defaults,
id: event.id, id: event.id,
repo_id: repo_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') || '', descritpion: event.tagValue('description') || '',
created_at: event.created_at, created_at: event.created_at,
comments: 0, comments: 0,
@ -206,3 +211,6 @@ function getAndUpdatePRStatus(prs: PRSummaries, repo: Repo): void {
}) })
}) })
} }
function extractTagContent(arg0: string): string {
throw new Error('Function not implemented.')
}

Loading…
Cancel
Save