fix: Check if form trigger URL is live before oppening pop-up (#15800)

This commit is contained in:
Michael Kret
2025-05-29 20:32:57 +03:00
committed by GitHub
parent be5f14e316
commit 041ada1fd6
3 changed files with 72 additions and 12 deletions

View File

@@ -103,7 +103,7 @@ export const openFormPopupWindow = (url: string) => {
export const clearPopupWindowState = () => (formPopupWindow = false);
export function displayForm({
export async function displayForm({
nodes,
runData,
pinData,
@@ -137,6 +137,14 @@ export function displayForm({
if (node.name === destinationNode || !node.disabled) {
let testUrl = '';
if (node.type === FORM_TRIGGER_NODE_TYPE) testUrl = getTestUrl(node);
try {
const res = await fetch(testUrl, { method: 'GET' });
if (!res.ok) continue;
} catch (error) {
continue;
}
if (testUrl && source !== 'RunData.ManualChatMessage') {
clearPopupWindowState();
openFormPopupWindow(testUrl);