Use more strict replacements in storage

pull/1/head
Alex Beregszaszi 8 years ago
parent f9ad4bcb2a
commit d521af5f28
  1. 4
      src/app/storage.js

@ -19,7 +19,7 @@ function Storage () {
}
this.keys = function () {
return safeKeys().filter(function (item) { return item.replace('sol:', '') })
return safeKeys().filter(function (item) { return item.replace(/^\.sol:/, '') })
}
this.remove = function (name) {
@ -45,7 +45,7 @@ function Storage () {
safeKeys().forEach(function (name) {
if (name.indexOf('sol-cache-file-', 0) === 0) {
var content = window.localStorage.getItem(name)
window.localStorage.setItem('sol:' + name.replace('sol-cache-file-', ''), content)
window.localStorage.setItem(name.replace(/^sol-cache-file-/, 'sol:'), content)
window.localStorage.removeItem(name)
}
})

Loading…
Cancel
Save