awcodes / recently

Easily track and access recently viewed records in your filament panels.
MIT License
33 stars 10 forks source link

[Bug]: using SPA Mode requires manual refresh of the Page for recent Items to be refreshed #13

Closed schaper1337 closed 3 weeks ago

schaper1337 commented 1 month ago

What happened?

When using SPA Mode, a manual refresh of the page is required, to see the correct list of recent entries in the dropdown.

How to reproduce the bug

Use SPA Mode and click through multiple pages that use the HasRecentHistoryRecorder Trait.

Package Version

1.0.3

PHP Version

8.2

Laravel Version

11.26.0

Which operating systems does with happen with?

No response

Notes

No response

schaper1337 commented 1 month ago

Suggestion: in src/Livewire/RecentlyMenu.php the $records should not be retrieved once on component mount() but rather each time in render().

awcodes commented 1 month ago

Feel free to PR the change. I'll review it with a reproduction repo. But the spa livewire mode isn't something I'm overly worried about since it's buggy. If you need an SPA then make an SPA.