mirror of
https://github.com/murdos/musicbrainz-userscripts
synced 2024-12-14 12:22:26 +00:00
Simplify initCache()
This commit is contained in:
parent
14179dda3f
commit
5f08654b16
1 changed files with 1 additions and 5 deletions
|
@ -45,11 +45,7 @@ var MBLinks = function (cachekey, expiration) {
|
||||||
this.initCache = function () {
|
this.initCache = function () {
|
||||||
if (!this.supports_local_storage) return;
|
if (!this.supports_local_storage) return;
|
||||||
// Check if we already added links for this content
|
// Check if we already added links for this content
|
||||||
var cache_string = localStorage.getItem(this.cache_key);
|
this.cache = JSON.parse(localStorage.getItem(this.cache_key) || '{}');
|
||||||
if (!cache_string) {
|
|
||||||
cache_string = "{}";
|
|
||||||
}
|
|
||||||
this.cache = JSON.parse(cache_string);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.saveCache = function () {
|
this.saveCache = function () {
|
||||||
|
|
Loading…
Reference in a new issue