Skip to content

Commit

Permalink
Merge pull request #116 from FeelgoodDE/master
Browse files Browse the repository at this point in the history
Handling for explicit usage of cookie fallback
  • Loading branch information
grevory committed Aug 14, 2014
2 parents 1437e35 + 570d765 commit f7dd45e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions angular-local-storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ angularLocalStorage.provider('localStorageService', function() {
var addToLocalStorage = function (key, value) {

// If this browser does not support local storage use cookies
if (!browserSupportsLocalStorage) {
if (!browserSupportsLocalStorage || this.storageType === 'cookie') {
$rootScope.$broadcast('LocalStorageModule.notification.warning', 'LOCAL_STORAGE_NOT_SUPPORTED');
if (notify.setItem) {
$rootScope.$broadcast('LocalStorageModule.notification.setitem', {key: key, newvalue: value, storageType: 'cookie'});
Expand Down Expand Up @@ -151,7 +151,7 @@ angularLocalStorage.provider('localStorageService', function() {
// Example use: localStorageService.get('library'); // returns 'angular'
var getFromLocalStorage = function (key) {

if (!browserSupportsLocalStorage) {
if (!browserSupportsLocalStorage || this.storageType === 'cookie') {
$rootScope.$broadcast('LocalStorageModule.notification.warning','LOCAL_STORAGE_NOT_SUPPORTED');
return getFromCookies(key);
}
Expand Down

0 comments on commit f7dd45e

Please sign in to comment.