Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
CB-9572 Get rid of Math.random() when making a request ID
Math.random() takes several seconds to work (at least on my Lumia 820)! That's why, when using AngularJS routing I experienced huge delays when loading partial views. This little change fixed that.

This closes #86
  • Loading branch information
scale-tone authored and Vladimir Kotikov committed Aug 28, 2015
1 parent fed5953 commit ec401c9e2c1403165032de1b183203279d2170ca
Showing 1 changed file with 2 additions and 1 deletion.
@@ -77,6 +77,7 @@ public void InjectScript()
XHRShim.HEADERS_RECEIVED = 2;
XHRShim.LOADING = 3;
XHRShim.DONE = 4;
XHRShim.incrementedCounter = 0;
XHRShim.prototype = {
isAsync: false,
onreadystatechange: null,
@@ -263,7 +264,7 @@ public void InjectScript()
}
// Generate unique request ID
var reqId = new Date().getTime().toString() + Math.random();
var reqId = new Date().getTime().toString() + XHRShim.incrementedCounter++;
var funk = function () {
__XHRShimAliases[reqId] = alias;

0 comments on commit ec401c9

Please sign in to comment.