This commit is contained in:
2026-11-02 20:31:15 +02:00
parent 8ddfa93f45
commit 1da273f1f3
131 changed files with 14802 additions and 526 deletions
+18 -10
View File
@@ -29,8 +29,12 @@ export function useInterestDraft<T>(name: string, initial: T) {
setForm,
key: draft.key,
clear: () => {
sessionStorage.removeItem(storage);
sessionStorage.removeItem('investemoz-participation-identity');
try {
sessionStorage.removeItem(storage);
sessionStorage.removeItem('investemoz-participation-identity');
} catch {
/* Storage failure must not turn a confirmed submission into an error. */
}
},
authenticate: () => {
const identity = draft.form as {
@@ -38,14 +42,18 @@ export function useInterestDraft<T>(name: string, initial: T) {
fullName?: string;
email?: string;
};
sessionStorage.setItem(
'investemoz-participation-identity',
JSON.stringify({
name: identity.fullName ?? identity.name ?? '',
email: identity.email ?? '',
}),
);
sessionStorage.setItem(storage, JSON.stringify(draft));
try {
sessionStorage.setItem(
'investemoz-participation-identity',
JSON.stringify({
name: identity.fullName ?? identity.name ?? '',
email: identity.email ?? '',
}),
);
sessionStorage.setItem(storage, JSON.stringify(draft));
} catch {
/* Authentication remains available when browser persistence is blocked. */
}
window.location.assign(
'/participar/entrar?return=' +
encodeURIComponent(location.pathname + location.search),