1. 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

Discussion in 'XenForo Questions and Support' started by imthebest, Aug 13, 2014.

  1. imthebest

    imthebest Formerly Super120

    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?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    They are triggered via ajax actions, not a timer.
     
  3. imthebest

    imthebest Formerly Super120

    So is this real time?
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    No, you need to perform an ajax action, such as clicking on an avatar, to trigger them.
     
  5. Amaury

    Amaury Well-Known Member

    I've noticed sometimes if you're just sitting there not clicking anything, you'll get an alert.
     
  6. Liam W

    Liam W Well-Known Member

    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...
     
  7. imthebest

    imthebest Formerly Super120

    Me too!
     
  8. Daniel Hood

    Daniel Hood Well-Known Member

    You're a developer..... don't wonder, dive in and find out.
     
    Liam W likes this.
  9. Liam W

    Liam W Well-Known Member

    I'll be doing that when I get around to it.

    When that'll be, I've no idea. Probably tonight.
     
  10. Daniel Hood

    Daniel Hood Well-Known Member

    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
     
    Bob, Amaury, Chris D and 2 others like this.
  11. Kaan SAKA

    Kaan SAKA Member

    is there anyway to get short this 50 minute ?
     
  12. Amaury

    Amaury Well-Known Member

    As far as I know, it would likely require an add-on or custom development.
     

Share This Page