mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 19:32:15 +00:00
fix: Check if form trigger URL is live before oppening pop-up (#15800)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user