From 11dfa43914921e2406414cddc4e1ae8fff8bea7e Mon Sep 17 00:00:00 2001 From: DemonGatanjieu <1027066412@qq.com> Date: Mon, 3 Aug 2026 05:10:25 +0800 Subject: [PATCH] fix: make appendRecipeOnCanvas async to support custom dialog await --- web/modules/ui_recipe_detail.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/modules/ui_recipe_detail.js b/web/modules/ui_recipe_detail.js index fae5e5c..0b8c144 100644 --- a/web/modules/ui_recipe_detail.js +++ b/web/modules/ui_recipe_detail.js @@ -80,7 +80,7 @@ export async function openRecipeOnCanvas(owner, recipe) { } } -export function appendRecipeOnCanvas(owner, recipe) { +export async function appendRecipeOnCanvas(owner, recipe) { try { appendRecipeToCanvas(recipe); closeRecipeWorkspace(owner); @@ -689,7 +689,7 @@ function renderOverview(content, owner, recipe, references, finish) { const append = button(actions, t('recipeAppendCanvas'), 'anomalous-btn-primary'); append.onclick = () => { void runRecipeAction(append, async () => { - if (appendRecipeOnCanvas(owner, recipe)) finish('append'); + if (await appendRecipeOnCanvas(owner, recipe)) finish('append'); }); }; const copyPrompt = button(actions, t('recipeDetailCopyPrompt'), 'anomalous-btn-primary'); @@ -1133,7 +1133,7 @@ export function showRecipeDetail(owner, { recipe, filename, history = [] }) { const append = button(headerActions, t('recipeAppendCanvas'), 'anomalous-btn-ghost'); append.onclick = () => { void runRecipeAction(append, async () => { - if (appendRecipeOnCanvas(owner, recipe)) finish('append'); + if (await appendRecipeOnCanvas(owner, recipe)) finish('append'); }); };