From b1ce75adab33f5feb4a6221172ae19b5ba5e2671 Mon Sep 17 00:00:00 2001 From: nicholas-codecov Date: Mon, 13 Jan 2025 10:43:06 -0400 Subject: [PATCH] tidy up isPending --- .../ConfigureCachedBundleModal.tsx | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/pages/RepoPage/BundlesTab/BundleContent/BundleSelection/ConfigureCachedBundleModal.tsx b/src/pages/RepoPage/BundlesTab/BundleContent/BundleSelection/ConfigureCachedBundleModal.tsx index 08b02e0d86..8e58155509 100644 --- a/src/pages/RepoPage/BundlesTab/BundleContent/BundleSelection/ConfigureCachedBundleModal.tsx +++ b/src/pages/RepoPage/BundlesTab/BundleContent/BundleSelection/ConfigureCachedBundleModal.tsx @@ -134,13 +134,13 @@ const BundleTable: React.FC = ({ interface BundleCachingModalBodyProps { bundleState: CachedBundle[] setBundleState: SetBundleState - isBundlesLoading: boolean + isBundlesPending: boolean } const BundleCachingModalBody: React.FC = ({ bundleState, setBundleState, - isBundlesLoading, + isBundlesPending, }) => { return ( <> @@ -157,7 +157,7 @@ const BundleCachingModalBody: React.FC = ({ Note, if caching is removed trend data will not be available. - {isBundlesLoading ? ( + {isBundlesPending ? ( ) : ( () const [bundleState, setBundleState] = useState([]) - const { mutate: updateBundleCache, isPending } = useUpdateBundleCache({ - provider, - owner, - repo, - }) + const { mutate: updateBundleCache, isPending: updateBundleCachePending } = + useUpdateBundleCache({ + provider, + owner, + repo, + }) const { data: repoOverview } = useRepoOverview({ provider, @@ -201,7 +202,7 @@ export const ConfigureCachedBundleModal = ({ }) const defaultBranch = repoOverview?.defaultBranch ?? '' - const { data: bundleData, isLoading: isBundlesLoading } = useQueryV5({ + const { data: bundleData, isPending: isBundlesPending } = useQueryV5({ ...CachedBundlesQueryOpts({ provider, owner, repo, branch: defaultBranch }), // we can use the select hook to transform the data to the format we want select: (data) => @@ -232,7 +233,7 @@ export const ConfigureCachedBundleModal = ({ } footer={ @@ -244,7 +245,7 @@ export const ConfigureCachedBundleModal = ({