Merge pull request #10172 from colinux/fix-banner-domain

Tech: fix pour la bannière du domaine
This commit is contained in:
Colin Darie 2024-03-21 21:04:30 +00:00 committed by GitHub
commit b6526cfad9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,7 +7,12 @@
}).catch((e) => {
const error = new Error("Connection test on new host failed: " + e);
const event = new CustomEvent("sentry:capture-exception", { detail: error });
setTimeout(() => dispatchEvent(event), 100); // listener is not immediately enabled
// listener is not immediately enabled, so wait a little bit
setTimeout(() => {
dispatchEvent(event);
document.getElementById("banner_auto_switch_error")?.classList?.remove("hidden");
}, 100);
})
@ -18,8 +23,8 @@
- if manual_switch?
= t(".follow_link")
- elsif auto_switch? || true
= t(".detected_error")
- elsif auto_switch?
%span#banner_auto_switch_error.hidden= t(".detected_error")
- if user && !user.preferred_domain_demarches_gouv_fr? && requested_from_new_domain?
= form_tag(helpers.preferred_domain_path, method: :patch, remote: true, name: "update-preferred-domain")