Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store events locally when selected #26

Open
jomo opened this issue Nov 24, 2018 · 1 comment
Open

Store events locally when selected #26

jomo opened this issue Nov 24, 2018 · 1 comment

Comments

@jomo
Copy link

jomo commented Nov 24, 2018

Is there a reason the selected events are only locally stored when submitted? IMO it would be better to store them whenever an event is selected. This allows you to close the tab (including accidentally) and come back later to finish the selection.

@erdgeist
Copy link
Collaborator

It has historic reasons: The single source of truth about what's selected is in the event div's classes, if they're selected, that means that you've selected them, which allows for some trivial aggregation. Then there's the list in localStorage which is your final list that's supposed to match what's on the server and that's later reused to set the initial selections once you come back to the site.

Now we'd need to immediately store selections and de-selections in a list in localStorage and check if it differs from the one that's a cache of what we believe is on the server. That list also may differ from what's actually on the server unless we add some more synchronization code.

All in all it's a major change in the model and I hesitate to do that on the live system now :)

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

No branches or pull requests

2 participants