Skip to content
This repository has been archived by the owner on Nov 22, 2018. It is now read-only.

Commit

Permalink
go-tour: fix storage when localStorage is not available in the browser.
Browse files Browse the repository at this point in the history
LGTM=adg
R=adg
CC=golang-codereviews
https://codereview.appspot.com/135030043
  • Loading branch information
campoy committed Aug 28, 2014
1 parent 1470951 commit 2e1616d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions static/js/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ factory('fmt', ['$http',
}
]).

// Local storage, persistent to page refreshing.
factory('storage', ['$window',
function(win) {
if (win.localStorage) {
Expand All @@ -73,8 +74,8 @@ factory('storage', ['$window',
};
}
return {
get: function(key, def) {
return def;
get: function() {
return null;
},
set: function() {}
};
Expand Down

0 comments on commit 2e1616d

Please sign in to comment.