mirror of
				https://github.com/Jermolene/TiddlyWiki5
				synced 2025-11-04 09:33:00 +00:00 
			
		
		
		
	Clear caches when changing plugins
This commit is contained in:
		@@ -1083,6 +1083,8 @@ $tw.Wiki = function(options) {
 | 
				
			|||||||
				});
 | 
									});
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
 | 
							this.clearCache(null);
 | 
				
			||||||
 | 
							this.clearGlobalCache();
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -742,11 +742,15 @@ 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) {
 | 
				
			||||||
	this.caches = this.caches || Object.create(null);
 | 
						if(title) {
 | 
				
			||||||
	if($tw.utils.hop(this.caches,title)) {
 | 
							this.caches = this.caches || Object.create(null);
 | 
				
			||||||
		delete this.caches[title];
 | 
							if($tw.utils.hop(this.caches,title)) {
 | 
				
			||||||
 | 
								delete this.caches[title];
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						} else {
 | 
				
			||||||
 | 
							this.caches = Object.create(null);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user