Skip to content

Commit

Permalink
Report throttled refreshes (#8116)
Browse files Browse the repository at this point in the history
Fixes GH #6054
  • Loading branch information
hoelzro authored Mar 29, 2024
1 parent e43cd2d commit 9939759
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/modules/startup/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ exports.startup = function() {
deferredChanges = Object.create(null);
$tw.hooks.invokeHook("th-page-refreshed");
}
var throttledRefresh = $tw.perf.report("throttledRefresh",refresh);

// Add the change event handler
$tw.wiki.addEventListener("change",$tw.perf.report("mainRefresh",function(changes) {
// Check if only tiddlers that are throttled have changed
Expand All @@ -101,7 +103,7 @@ exports.startup = function() {
if(isNaN(timeout)) {
timeout = THROTTLE_REFRESH_TIMEOUT;
}
timerId = setTimeout(refresh,timeout);
timerId = setTimeout(throttledRefresh,timeout);
$tw.utils.extend(deferredChanges,changes);
} else {
$tw.utils.extend(deferredChanges,changes);
Expand Down

0 comments on commit 9939759

Please sign in to comment.