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

On item pages, fetch the item's library data to the store if it's not available #3212

Merged
merged 4 commits into from
Jul 30, 2024

Conversation

mikiher
Copy link
Contributor

@mikiher mikiher commented Jul 30, 2024

This fixes #3209

The fix fixes the problem by making sure filterData is available in the store when the item page is loaded.

There might be some refactoring needed in libraries.js to make sure that dependent state variables are updated together. Currently for example, it is possible to change the currentLibraryId without trigerring a library fetch, which leaves the libraries state in an incosistent state (filterData is not updated, for example). Let me know what you think.

@mikiher mikiher marked this pull request as ready for review July 30, 2024 17:14
@advplyr advplyr merged commit 787c4e4 into advplyr:master Jul 30, 2024
4 checks passed
@advplyr
Copy link
Owner

advplyr commented Jul 30, 2024

The setCurrentLibrary calls shouldn't be happening so I replaced those. As far as I could tell the filterData should stay in sync.

I agree some refactoring can be helpful here.

  • Collections and userPlaylists don't need to be loaded into state.
  • There is still the old listeners setup in there that is used by LibraryTable.vue. Instead of listeners in the state it should be using socket events directly. Cleaner that way.
  • Filter data in general feels hacky. I'm sure there is a better way to keep that refreshed and up-to-date. I don't have a specific solution off the top of my head.
  • In the asyncData for all the library pages libraries/fetch is getting called every time instead of only when necessary.

As for this PR the issue is fixed. Thanks!

@mikiher mikiher deleted the library-fetch branch July 31, 2024 14:05
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

Successfully merging this pull request may close these issues.

[Bug]: Match selection modal unresponsive when coming from an external link
2 participants