feat(planner): add isLoading prop to SwapSuggestionList — disables Pick buttons during PATCH
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -61,6 +61,7 @@
|
||||
let pickerOpen = $state(false);
|
||||
let actionSheetOpen = $state(false);
|
||||
let swapSheetOpen = $state(false);
|
||||
let swapLoading = $state(false);
|
||||
|
||||
// Recipes already in any slot this week — used for ⚠ overlap warnings
|
||||
let currentWeekRecipeIds = $derived(
|
||||
@@ -139,8 +140,10 @@
|
||||
}
|
||||
|
||||
async function handleSwapPick(recipeId: string, recipeName: string) {
|
||||
swapSheetOpen = false;
|
||||
swapLoading = true;
|
||||
await handleRecipePick(recipeId, recipeName);
|
||||
swapSheetOpen = false;
|
||||
swapLoading = false;
|
||||
}
|
||||
|
||||
function closePanelToIdle() {
|
||||
@@ -306,6 +309,7 @@
|
||||
replacingMeta={replacingMeta || undefined}
|
||||
recipes={sortedRecipes}
|
||||
{currentWeekRecipeIds}
|
||||
isLoading={swapLoading}
|
||||
onpick={handleSwapPick}
|
||||
oncancel={() => (swapSheetOpen = false)}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user