Skip to content

Commit

Permalink
update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholas-codecov committed Jan 13, 2025
1 parent 213dd2b commit 4d238f4
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ export const ConfigureCachedBundleModal = ({

const { data: bundleData, isLoading: isBundlesLoading } = useQueryV5({
...CachedBundlesQueryOpts({ provider, owner, repo, branch: defaultBranch }),
// we can use the select hook to transform the data to the format we want
select: (data) =>
data.bundles.map((bundle) => ({
bundleName: bundle.bundleName,
Expand All @@ -211,12 +212,13 @@ export const ConfigureCachedBundleModal = ({
enabled: isOpen && !!defaultBranch,
})

// if the bundle data is loaded and the bundle state is empty, set the bundle state
if (bundleData && bundleData.length > 0 && bundleState.length === 0) {
setBundleState(bundleData)
}

const closeModal = () => {
// this resets the context state when the modal is closed
// this resets the state when the modal is closed
setBundleState([])
setIsOpen(false)
}
Expand Down

0 comments on commit 4d238f4

Please sign in to comment.