-
Notifications
You must be signed in to change notification settings - Fork 62
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
this gem is not compatible with turbolinks #16
Comments
@killernova you should be able to add an ignore attribute for turbolinks when #18 is merged in, please have a look at the added test case |
@emilos Yes, I've noticed this PR many days ago, but I've written some codes to replace the |
@killernova #18 has been merged. Does that fix your problem? |
I can confirm this is still a problem when Turbolinks is enabled. Replicated by logging in and clicking a few times. A request to
|
I'll try reproducing this when I have time. If anyone wants to submit a PR fix in the meantime, please do. |
I was able to reproduce this problem and am working on a fix. |
If someone else has this problem too, this may help with Turbo and Stimulus. On every page change, stimulus calls the disconnect function, where the already running function is stopped. Important: Do not use
Content of app/javascript/controllers/auto_session_timeout_controller.js:
And in
Additionally, I had to adjust
|
When use turbolinks, consider clicking the 'next page' button of a list for several times, the trigger of post '/active' will repeat for this times. e.g. I
auto_session_timeout_js frequency: 120
, and then click 'next page' for 5 times, then every 120 seconds will post to/action
for 5 times. That's caused by write the codes in body. The correct way to do is wrapping the codes in$('document').on('turbolinks:load', function(){})
.The text was updated successfully, but these errors were encountered: