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

gon.watch not update variable in different browser windows. #242

Open
vader1359 opened this issue Feb 28, 2018 · 0 comments
Open

gon.watch not update variable in different browser windows. #242

vader1359 opened this issue Feb 28, 2018 · 0 comments

Comments

@vader1359
Copy link

I set up a gon variable for checking if current user is available in controller.
gon.watch.has_current_user = current_user.present?
I open a page (with current user presents) and duplicate that page to a new browser window.
I logged out in one page and call gon.watch('has_current_user'), then call alert(gon.has_current_user in the console. The variable was updated from true to false successfully.
Now I called the same two methods in the page I had not logged out. I assume that the variable must be checked and updated again by gon.watch and become false, too. However, the current_user still existed there.
Why?

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

No branches or pull requests

1 participant