-
Notifications
You must be signed in to change notification settings - Fork 31
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
Made recent searches be stored per-account #684
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we should be storing an account based value on the APIClient
as the client needs to work without accounts too (guest mode).
It's also stored on the client only to be read back out to pass as an argument elsewhere which seems odd.
Would it be better to simply make the recent search tracker / persistence take something like the instance URL as an argument to use as the key?
The communities and user ids will be correct on the same instance for example, even if someone had multiple accounts on the same instance 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - there's a test failure for a mismatch of Int
instead of String
, so I disabled auto-merge in case this approval made it merge when I hit enter 😅
Checklist
- Slack
Pull Request Information
Changed how recent searches are handled persist them per-account. This involves:
loadRecentSearches
toreloadRecentSearches
, which will clear the value and reload using the current account hash (it's only called in one place on.onAppear
, so this shouldn't break anything)accountHash
to list ofContentModelIdentifier
Recent.Search.Per.Account.PR.mov