Skip to content

Commit 7934a0a

Browse files
committed
fix react hook error
1 parent 377c475 commit 7934a0a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

website/src/components/chat-buttons.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,7 @@ export function PrButton({ className = '' }) {
5151
return doFilesInDraftNeedPush(filesInDraft, lastPushedFiles)
5252
}, [filesInDraft, lastPushedFiles])
5353

54-
if (!siteData) return null
55-
if (!siteData.site.githubInstallations?.length) return null
56-
if (!siteData.site.githubOwner || !siteData.site.githubRepo) return null
57-
if (!messages?.length) return null
54+
5855

5956
const prHref = href('/org/:orgId/site/:siteId/chat/:chatId/create-pr', {
6057
orgId,
@@ -151,6 +148,11 @@ export function PrButton({ className = '' }) {
151148
}
152149
})()
153150

151+
if (!siteData) return null
152+
if (!siteData.site.githubInstallations?.length) return null
153+
if (!siteData.site.githubOwner || !siteData.site.githubRepo) return null
154+
if (!messages?.length) return null
155+
154156
return (
155157
<div className={cn('flex items-center gap-2', className)}>
156158
<Tooltip>

0 commit comments

Comments
 (0)