Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Statemanager is not persisting Form on page reload, when using sessionStorage #55

Open
Bulebu opened this issue Sep 17, 2021 · 0 comments

Comments

@Bulebu
Copy link

Bulebu commented Sep 17, 2021

I think this was mentioned before, but in my opinion it's still a bug.

When u reload ur page while using sessionStorage the ngForms object is always empty and getNgForm will always return null.
And that's because

evaluates to true, since there is initial data in the session storage and

} else {
/** else update the store with the current form state */
this.updateStore(formName, form, true);
if (merged.persistForm) {
this.storeFormInstance(formName, form);
}
}

is never reached.

Maybe changing it to something like
if(!this.ngForms[formName]) { this.storeFormInstance(formName, form); }

might fix that issue.

Cheers,
Kristof

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant