Created
March 3, 2025 13:17
-
-
Save runzway/423b92a8b28550aac50b3f664a523514 to your computer and use it in GitHub Desktop.
Bug fix: Livewire fast navigation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Rezolva bugul de navigare | |
* 'Too many calls to location or history APIs in a short period of time.' | |
* Exista un PR pentru Livewire care rezolva asta dar inca nu este merged | |
* Probabil ca pe viitor vom scoate codul asta | |
* | |
*/ | |
const original = window.history.replaceState; | |
let previousState = null | |
window.history.replaceState = function (state, unused, url) { | |
state.url = url instanceof URL ? url.toString() : url | |
if (JSON.stringify(state) === JSON.stringify(previousState)) { | |
return | |
} | |
original.apply(this, [state, unused, url]) | |
previousState = state | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In PanelProvider, boot() method
then
php artisan filament:assets