Prefix localstorage keys with "Radarr"

Updates #285
This commit is contained in:
Tim Turner 2017-01-22 15:54:37 -05:00
parent 309877bf76
commit 266f28883a
1 changed files with 5 additions and 0 deletions

View File

@ -2,6 +2,8 @@ var $ = require('jquery');
var vent = require('./vent');
module.exports = {
ConfigNamespace : 'Radarr',
Events : {
ConfigUpdatedEvent : 'ConfigUpdatedEvent'
},
@ -16,6 +18,7 @@ module.exports = {
},
getValueJson : function (key, defaultValue) {
key = this.ConfigNamespace + key;
defaultValue = defaultValue || {};
var storeValue = window.localStorage.getItem(key);
@ -34,6 +37,7 @@ module.exports = {
},
getValue : function(key, defaultValue) {
key = this.ConfigNamespace + key;
var storeValue = window.localStorage.getItem(key);
if (!storeValue) {
@ -48,6 +52,7 @@ module.exports = {
},
setValue : function(key, value) {
key = this.ConfigNamespace + key;
console.log('Config: [{0}] => [{1}]'.format(key, value));
if (this.getValue(key) === value.toString()) {