Improved: setLocaleFromBrowser should only called once by session
As Deepak mentioned in r1816537, currenlty setLocaleFromBrowser is called each
time a page is refreshed.
We can use sessionStorage to have it called only once by session
Thanks: Deepak for reporting an issue which was boring me for long :)
@@ -17,6 +17,9 @@ specific language governing permissions and limitations
under the License.
*/
+// Only once by session
+if (sessionStorage.getItem("setLocaleFromBrowser") === null || sessionStorage.getItem("setLocaleFromBrowser") !== "done") {
+ sessionStorage.setItem("setLocaleFromBrowser", "done");
var timezone = moment.tz.guess();
$.ajax({
url: "setLocaleFromBrowser",
@@ -29,3 +32,4 @@ $.ajax({
}
}
});
+}
