Skip to content

Commit

Permalink
fix: only make account details call when user is part of org
Browse files Browse the repository at this point in the history
  • Loading branch information
calvin-codecov committed Jan 27, 2025
1 parent b5435b1 commit fbca66a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/pages/OwnerPage/HeaderBanners/HeaderBanners.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ const AlertBanners = ({ isUploadLimitExceeded, isApproachingUploadLimit }) => {
AlertBanners.propTypes = {
isUploadLimitExceeded: PropTypes.bool.isRequired,
isApproachingUploadLimit: PropTypes.bool.isRequired,
hasGhApp: PropTypes.bool.isRequired,
}

export default function HeaderBanners() {
Expand Down
3 changes: 3 additions & 0 deletions src/pages/OwnerPage/OwnerPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ function OwnerPage() {
const { data: accountDetails } = useAccountDetails({
provider,
owner,
opts: {
enabled: !!ownerData?.isCurrentUserPartOfOrg,
},
})

const hasGhApp = !!accountDetails?.integrationId
Expand Down
2 changes: 1 addition & 1 deletion src/services/account/usePlanData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const PlanDataSchema = z
.object({
owner: z
.object({
hasPrivateRepos: z.boolean(),
hasPrivateRepos: z.boolean().nullish(),
plan: PlanSchema.nullish(),
pretrialPlan: PretrialPlanSchema.nullish(),
})
Expand Down

0 comments on commit fbca66a

Please sign in to comment.