From 9a7e18e6518c16e569ebb0043d2d6b0bd35ff7ff Mon Sep 17 00:00:00 2001 From: bennykok Date: Thu, 1 Aug 2024 10:50:02 -0700 Subject: [PATCH] fix: fe communication --- web-plugin/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web-plugin/index.js b/web-plugin/index.js index f335250..8b80364 100644 --- a/web-plugin/index.js +++ b/web-plugin/index.js @@ -278,7 +278,11 @@ const ext = { sendEventToCD("cd_plugin_onDeployChanges", prompt); } else if (message.type === "queue_prompt") { const prompt = await app.graphToPrompt(); - api.handlePromptGenerated(prompt); + if (typeof api.handlePromptGenerated === "function") { + api.handlePromptGenerated(prompt); + } else { + console.warn("api.handlePromptGenerated is not a function"); + } sendEventToCD("cd_plugin_onQueuePrompt", prompt); } else if (message.type === "get_prompt") { const prompt = await app.graphToPrompt();