commit16
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user