Skip to content

Instantly share code, notes, and snippets.

@liorkesos
Created October 28, 2013 16:14
Show Gist options
  • Select an option

  • Save liorkesos/7199812 to your computer and use it in GitHub Desktop.

Select an option

Save liorkesos/7199812 to your computer and use it in GitHub Desktop.
$(document).ready(function() {
$.get("/0.1/user", function(data) {
window.user = data.user;
window.online = true;
window.bootstrap();
}).fail(function(jqXHR, textStatus, errorThrown) {
var userString = localStorage.getItem('ls.localUser');
window.user = JSON.parse(userString);
window.online = false;
window.bootstrap();
}).error(function(jqXHR, textStatus, errorThrown) {
var userString = localStorage.getItem('ls.localUser');
window.user = JSON.parse(userString);
window.online = false;
window.bootstrap();
});
});
@liorkesos
Copy link
Author

The main issue we see is related to reading the info from the localstorage and not from the session info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment