diff --git a/frontend/scripts/controllers.js b/frontend/scripts/controllers.js index 0bebbc9..a101cbd 100644 --- a/frontend/scripts/controllers.js +++ b/frontend/scripts/controllers.js @@ -131,12 +131,12 @@ angular.module('imgbi.controllers', []) }; getFullStorage().then(function(storage) { angular.forEach(storage, function(content, id) { - if (id != 'lang' && id != 'expire') { + if (id.substring(0, 6) == 'imgbi_' && id != 'imgbi_lang' && id != 'imgbi_expire') { if (typeof content !== 'object') { content = JSON.parse(content); } $rootScope.thumbs.push({ - id: id, + id: id.substring(6, id.length), pass: content.pass, rmpass: content.rmpass }); diff --git a/frontend/scripts/storage.js b/frontend/scripts/storage.js index bcd415b..1ab0a0e 100644 --- a/frontend/scripts/storage.js +++ b/frontend/scripts/storage.js @@ -1,7 +1,7 @@ angular.module('imgbi.storage', []) .factory('rmStorage', [function() { return function(id) { - localStorage.removeItem(id); + localStorage.removeItem('imgbi_' + id); }; }]) .factory('setStorage', [function() { @@ -9,16 +9,16 @@ angular.module('imgbi.storage', []) if (typeof value === 'object') { value = JSON.stringify(value); } - localStorage.setItem(id, value); + localStorage.setItem('imgbi_' + id, value); }; }]) .factory('getStorage', ['$q', function($q) { return function(id) { var deferred = $q.defer(); if (id != 'lang' && id != 'expire') { - deferred.resolve(JSON.parse(localStorage.getItem(id))); + deferred.resolve(JSON.parse(localStorage.getItem('imgbi_' + id))); } else { - deferred.resolve(localStorage.getItem(id)); + deferred.resolve(localStorage.getItem('imgbi_' + id)); } return deferred.promise; };