1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-09-29 07:20:47 +00:00

Clear caches when changing plugins

This commit is contained in:
Jermolene 2015-08-02 22:22:33 +01:00
parent bc0d8c7c65
commit 9168480d18
2 changed files with 10 additions and 4 deletions

View File

@ -1083,6 +1083,8 @@ $tw.Wiki = function(options) {
}); });
} }
}); });
this.clearCache(null);
this.clearGlobalCache();
}; };
}; };

View File

@ -742,12 +742,16 @@ exports.getCacheForTiddler = function(title,cacheName,initializer) {
} }
}; };
// Clear all caches associated with a particular tiddler // Clear all caches associated with a particular tiddler, or, if the title is null, clear all the caches for all the tiddlers
exports.clearCache = function(title) { exports.clearCache = function(title) {
if(title) {
this.caches = this.caches || Object.create(null); this.caches = this.caches || Object.create(null);
if($tw.utils.hop(this.caches,title)) { if($tw.utils.hop(this.caches,title)) {
delete this.caches[title]; delete this.caches[title];
} }
} else {
this.caches = Object.create(null);
}
}; };
exports.initParsers = function(moduleType) { exports.initParsers = function(moduleType) {