Skip to content

Commit

Permalink
fix: fix repo list is empty crash
Browse files Browse the repository at this point in the history
  • Loading branch information
baiwusanyu-c committed Apr 19, 2023
1 parent 2600448 commit c67f5c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/extension/chrome-option/components/HeaderBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const HeaderBar = (props: HeaderBarProps = {
<a href={props.userInfo.html_url} target="_blank" rel="noreferrer" title={props.userInfo.html_url}>
<Avatar size={46} src={props.userInfo.avatar_url} icon={<UserOutlined />} />
</a>
<h1 className="mx-4 my-0 text-gray-600 text-xl dark:text-white">{props.repoInfo.uname}</h1>
<h1 className="mx-4 my-0 text-gray-600 text-xl dark:text-white">{props.repoInfo.uname || ''}</h1>
</div>
<div className="flex items-center">
<a
Expand Down
4 changes: 2 additions & 2 deletions packages/extension/chrome-option/components/RepoList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const RepoList = (props: IRepoListProps) => {
const resRepo = [...repos.values()]
setRepoList(resRepo)
repoListCache.current = resRepo
onSelect(resRepo[0])
resRepo.length > 0 && onSelect(resRepo[0])
})
.finally(() => {
setLoading(false)
Expand All @@ -70,7 +70,7 @@ export const RepoList = (props: IRepoListProps) => {
const resRepo = [...repos.values()]
setRepoList(resRepo)
repoListCache.current = resRepo
onSelect(resRepo[0])
resRepo.length > 0 && onSelect(resRepo[0])
}).finally(() => {
setLoading(false)
})
Expand Down

0 comments on commit c67f5c4

Please sign in to comment.