From 13eb87da3542328d34fa3a55223d3acb7b058e9e Mon Sep 17 00:00:00 2001 From: Kiahna Tucker Date: Thu, 20 Feb 2025 10:49:06 -0500 Subject: [PATCH] Increase sensitivity to backfill all button --- .../editor/Bindings/Backfill/BackfillButton.tsx | 6 ++---- .../Bindings/Backfill/useUpdateBackfillCounter.ts | 10 +++++++++- src/stores/Binding/Store.ts | 1 + 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/components/editor/Bindings/Backfill/BackfillButton.tsx b/src/components/editor/Bindings/Backfill/BackfillButton.tsx index 88ef4d485..acc4a5e78 100644 --- a/src/components/editor/Bindings/Backfill/BackfillButton.tsx +++ b/src/components/editor/Bindings/Backfill/BackfillButton.tsx @@ -151,16 +151,14 @@ function BackfillButton({ increment, bindingMetadata ).then( - () => { + (processedCollections) => { const targetBindingUUID = singleBindingUpdate ? currentBindingUUID : undefined; setBackfilledBindings(increment, targetBindingUUID); - evaluateTrialCollections( - bindingMetadata.map(({ collection }) => collection) - ).then( + evaluateTrialCollections(processedCollections).then( (response) => { setCollectionMetadata(response, []); }, diff --git a/src/components/editor/Bindings/Backfill/useUpdateBackfillCounter.ts b/src/components/editor/Bindings/Backfill/useUpdateBackfillCounter.ts index 003628bd8..9d61710ee 100644 --- a/src/components/editor/Bindings/Backfill/useUpdateBackfillCounter.ts +++ b/src/components/editor/Bindings/Backfill/useUpdateBackfillCounter.ts @@ -135,7 +135,15 @@ function useUpdateBackfillCounter() { return Promise.reject(updateResponse.error); } - return mutateDraftSpecs(); + const mutateResponse = await mutateDraftSpecs(); + + if (!mutateResponse) { + return Promise.reject(); + } + + return bindingMetadataExists + ? bindingMetadata.map(({ collection }) => collection) + : Object.keys(bindings); }, [ backfilledBindings, diff --git a/src/stores/Binding/Store.ts b/src/stores/Binding/Store.ts index 67d8b8dfd..1852af72c 100644 --- a/src/stores/Binding/Store.ts +++ b/src/stores/Binding/Store.ts @@ -820,6 +820,7 @@ const getInitialState = ( sourceBackfillRecommended: isBeforeTrialInterval(updated_at) && (added || + state.backfillAllBindings || backfilledCollections.includes(catalog_name)), trialStorage: true, updatedAt: updated_at,