• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.4 Question about AJAX notifications

imthebest

Well-known member
#1
I see that when you're reading a thread for example and you get a new personal conversation the system loads an AJAX notification. Is this in real time or it happens each x minutes? If so, is that value configurable?
 

Liam W

Well-known member
#6
I've noticed sometimes if you're just sitting there not clicking anything, you'll get an alert.
I've noticed that to. Mainly when the page has been open for ages and I navigate back to it.

I've always wondered what triggers the update...
 

Daniel Hood

Well-known member
#10
I'll be doing that when I get around to it.

When that'll be, I've no idea. Probably tonight.
I'll save you some time.
XenForo uses ajax to refresh your csrf token after you're inactive for a long period of time. If you keep your tab open for at least 50 minutes without focusing on it, next time you make it the active tab, it'll use ajax to refresh the token which also checks for unread messages and new alerts.
If you really are curious you can look at this area in xenforo.js:
XenForo.CsrfRefresh