Closed bodom0015 closed 4 years ago
I may be misunderstanding, but this doesn't appear to be working for me. I tried capturing here https://recordit.co/SirrdwyySP, but it may be be entirely clear.
If I change the filter without refreshing, then go to view or manage and back to the dashboard, the filter resets. If I change the filter and refresh then it works as described. It seems that the refresh is persisting the filter?
I ran through the test steps fine, but I was expecting the filter to be set without needing the refresh and resetting on the refresh.
Good catch! Sorry about that - I had apparently only been testing using refresh, and not by actually navigating.
@craig-willis was correct and somehow my first commit was misbehaving because the getItem
was only being called after a refresh (and not everytime the view loaded). I think I've corrected it now if you're willing to take another look.
@ThomasThelen I'm not sure what you mean by "resetting on the refresh", as I was thinking that this feature was meant to persist between refreshes. Perhaps I am misunderstanding?
Verified that the following now works, which I think captures the full issue and all edge cases:
I wasn't sure what the expected behavior was-but I generally expect page refreshes to reset most UI elements (which might be an incorrect assumption). If no one else thinks so, then this PR looks good to me!
Problem
The Browse view doesn't remember the state of the selected filters.
Fixes #564
Approach
localStorage
when it changes.localStorage
when view initializes.How to Test
All Tales
My Tales
and refresh the pageMy Tales
is selected by defaultMy Tales
is still selected by default