fix(n8n Form Node): Redirection update (no-changelog) (#13104)

Co-authored-by: Dana <152518854+dana-gill@users.noreply.github.com>
This commit is contained in:
Michael Kret
2025-02-19 14:59:38 +02:00
committed by GitHub
parent 60ff82f648
commit 755734d349
15 changed files with 288 additions and 131 deletions

View File

@@ -779,14 +779,20 @@
if (json?.redirectURL) {
const url = json.redirectURL.includes("://") ? json.redirectURL : "https://" + json.redirectURL;
window.location.replace(url);
} else if (json?.formSubmittedText) {
return;
}
if (json?.formSubmittedText) {
form.style.display = 'none';
document.querySelector('#submitted-form').style.display = 'block';
document.querySelector('#submitted-content').textContent = json.formSubmittedText;
} else {
document.body.innerHTML = text;
return;
}
if (text) {
document.body.innerHTML = text;
return;
}
return;
}
if (response.status === 200) {
@@ -814,18 +820,6 @@
.catch(function (error) {
console.error('Error:', error);
});
const isWaitingForm = window.location.href.includes('form-waiting');
if(isWaitingForm) {
const interval = setInterval(function() {
const isSubmited = document.querySelector('#submitted-form').style.display;
if(isSubmited === 'block') {
clearInterval(interval);
return;
}
window.location.reload();
}, 2000);
}
}
});
</script>