mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 04:15:30 +00:00
fix issue with array index out of bounds when accessing linkedConnections
This commit is contained in:
parent
f8ac8b62a2
commit
0bb47cdc50
2 changed files with 16 additions and 11 deletions
|
|
@ -95,6 +95,7 @@ export const ErrorNavIndicator = () => {
|
|||
<div className="flex flex-col gap-2">
|
||||
{repos
|
||||
.slice(0, 10)
|
||||
.filter(item => item.linkedConnections.length > 0) // edge case: don't show repos that are orphaned and awaiting gc.
|
||||
.map(repo => (
|
||||
// Link to the first connection for the repo
|
||||
<Link key={repo.repoId} href={`/${domain}/connections/${repo.linkedConnections[0].id}`} onClick={() => captureEvent('wa_error_nav_job_pressed', {})}>
|
||||
|
|
|
|||
|
|
@ -48,17 +48,21 @@ export const ProgressNavIndicator = () => {
|
|||
The following repositories are currently being indexed:
|
||||
</p>
|
||||
<div className="flex flex-col gap-2 pl-4">
|
||||
{inProgressRepos.slice(0, 10).map(item => (
|
||||
// Link to the first connection for the repo
|
||||
<Link key={item.repoId} href={`/${domain}/connections/${item.linkedConnections[0].id}`} onClick={() => captureEvent('wa_progress_nav_job_pressed', {})}>
|
||||
<div className="flex items-center gap-2 px-3 py-2 bg-green-50 dark:bg-green-900/20
|
||||
rounded-md text-sm text-green-700 dark:text-green-300
|
||||
border border-green-200/50 dark:border-green-800/50
|
||||
hover:bg-green-100 dark:hover:bg-green-900/30 transition-colors">
|
||||
<span className="font-medium truncate">{item.repoName}</span>
|
||||
</div>
|
||||
</Link>
|
||||
))}
|
||||
{
|
||||
inProgressRepos.slice(0, 10)
|
||||
.filter(item => item.linkedConnections.length > 0) // edge case: don't show repos that are orphaned and awaiting gc.
|
||||
.map(item => (
|
||||
// Link to the first connection for the repo
|
||||
<Link key={item.repoId} href={`/${domain}/connections/${item.linkedConnections[0].id}`} onClick={() => captureEvent('wa_progress_nav_job_pressed', {})}>
|
||||
<div className="flex items-center gap-2 px-3 py-2 bg-green-50 dark:bg-green-900/20
|
||||
rounded-md text-sm text-green-700 dark:text-green-300
|
||||
border border-green-200/50 dark:border-green-800/50
|
||||
hover:bg-green-100 dark:hover:bg-green-900/30 transition-colors">
|
||||
<span className="font-medium truncate">{item.repoName}</span>
|
||||
</div>
|
||||
</Link>
|
||||
)
|
||||
)}
|
||||
{inProgressRepos.length > 10 && (
|
||||
<div className="text-sm text-green-600/90 dark:text-green-300/90 pl-3 pt-1">
|
||||
And {inProgressRepos.length - 10} more...
|
||||
|
|
|
|||
Loading…
Reference in a new issue