mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-27 09:24:45 +00:00
Add throttling for changed tiddlers prefixed with $:/temp/volatile/ (#5458)
This commit is contained in:
parent
05d38054c8
commit
1ddc3ab037
@ -82,7 +82,7 @@ exports.startup = function() {
|
|||||||
var onlyThrottledTiddlersHaveChanged = true;
|
var onlyThrottledTiddlersHaveChanged = true;
|
||||||
for(var title in changes) {
|
for(var title in changes) {
|
||||||
var tiddler = $tw.wiki.getTiddler(title);
|
var tiddler = $tw.wiki.getTiddler(title);
|
||||||
if(!tiddler || !(tiddler.hasField("draft.of") || tiddler.hasField("throttle.refresh"))) {
|
if(!$tw.wiki.isVolatileTiddler(title) && (!tiddler || !(tiddler.hasField("draft.of") || tiddler.hasField("throttle.refresh")))) {
|
||||||
onlyThrottledTiddlersHaveChanged = false;
|
onlyThrottledTiddlersHaveChanged = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -221,6 +221,10 @@ exports.isTemporaryTiddler = function(title) {
|
|||||||
return title && title.indexOf("$:/temp/") === 0;
|
return title && title.indexOf("$:/temp/") === 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.isVolatileTiddler = function(title) {
|
||||||
|
return title && title.indexOf("$:/temp/volatile/") === 0;
|
||||||
|
};
|
||||||
|
|
||||||
exports.isImageTiddler = function(title) {
|
exports.isImageTiddler = function(title) {
|
||||||
var tiddler = this.getTiddler(title);
|
var tiddler = this.getTiddler(title);
|
||||||
if(tiddler) {
|
if(tiddler) {
|
||||||
@ -1549,4 +1553,3 @@ exports.slugify = function(title,options) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
created: 20191013095916159
|
created: 20191013095916159
|
||||||
modified: 20191014093837558
|
modified: 20210203231820284
|
||||||
tags: RefreshMechanism
|
tags: RefreshMechanism
|
||||||
title: RefreshThrottling
|
title: RefreshThrottling
|
||||||
type: text/vnd.tiddlywiki
|
type: text/vnd.tiddlywiki
|
||||||
@ -11,6 +11,7 @@ The rules governing refresh throttling are:
|
|||||||
* When a change notification occurs, throttling will only take place if all of the modified tiddlers meet at least one of these criteria:
|
* When a change notification occurs, throttling will only take place if all of the modified tiddlers meet at least one of these criteria:
|
||||||
** Has the field `draft.of`
|
** Has the field `draft.of`
|
||||||
** Has the field `throttle.refresh`
|
** Has the field `throttle.refresh`
|
||||||
|
** Has a title prefixed with `$:/temp/volatile/`
|
||||||
* If the refresh cycle is to be throttled, a timer is set for the internal specified in [[$:/config/Drafts/TypingTimeout|Hidden Setting: Typing Refresh Delay]] (cancelling any preciously set timer)
|
* If the refresh cycle is to be throttled, a timer is set for the internal specified in [[$:/config/Drafts/TypingTimeout|Hidden Setting: Typing Refresh Delay]] (cancelling any preciously set timer)
|
||||||
** When the timer fires, the refresh cycle is triggered, passing the aggregated titles of all the deferred refresh cycles
|
** When the timer fires, the refresh cycle is triggered, passing the aggregated titles of all the deferred refresh cycles
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user