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

[Hot Cards] Fix element duplication and missing homepage holo effect #383

Merged
merged 5 commits into from
Aug 2, 2024

Conversation

HandyRandyx
Copy link
Contributor

  • Fix holo effect not showing on home page
  • Fix duplication of hot card elements by properly handling navigation events.

Duplication of elements was not noticeable until the holo style was introduced, which in case of duplication, becomes evident in the DOM.

- waitForImageLoad was not working as expected. Now receives an element instead of a selector.
There was a bug associated with this that happened when, for example, if we were in home and a user navigated to a gallery that had no performer or scene linked, when navigating backwards while waitForClass had not yet timed out, there would be a second waitForClass that would run, thus duplicating the hot-card elements.
When the user navigated to home, if he navigated to another section before the timeout ended, (handleHotCards * enabled cards) functions were run, and, if there were hot cards in the given section, the elements were duplicated because of the additional handleHotCards that would run in the current page.

- Add reusable overrideHistoryMethods function in helpers.js
- Replace code with new overrideHistoryMethods function
@DogmaDragon DogmaDragon merged commit d55fc05 into stashapp:main Aug 2, 2024
2 checks passed
@HandyRandyx HandyRandyx deleted the hot-cards branch August 2, 2024 06:16
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.

2 participants