mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-04-02 18:19:50 -04:00
FIX: spinning favicon in Firefox
Delay starting up ajax calls in MessageBus
This commit is contained in:
parent
ee8be3d1a8
commit
6c1d5b8cd3
1 changed files with 14 additions and 1 deletions
|
@ -12,7 +12,20 @@ export default {
|
|||
siteSettings = container.lookup('site-settings:main');
|
||||
|
||||
messageBus.alwaysLongPoll = Discourse.Environment === "development";
|
||||
messageBus.start();
|
||||
|
||||
// we do not want to start anything till document is complete
|
||||
messageBus.stop();
|
||||
// jQuery ready is called on "interactive" we want "complete"
|
||||
// Possibly change to document.addEventListener('readystatechange',...
|
||||
// but would only stop a handful of interval, message bus being delayed by
|
||||
// 500ms on load is fine. stuff that needs to catch up correctly should
|
||||
// pass in a position
|
||||
const interval = setInterval(()=>{
|
||||
if (document.readyState === "complete") {
|
||||
clearInterval(interval);
|
||||
messageBus.start();
|
||||
}
|
||||
},500);
|
||||
|
||||
messageBus.callbackInterval = siteSettings.anon_polling_interval;
|
||||
messageBus.backgroundCallbackInterval = siteSettings.background_polling_interval;
|
||||
|
|
Loading…
Add table
Reference in a new issue