镜像自地址
https://github.com/binary-husky/gpt_academic.git
已同步 2025-12-06 22:46:48 +00:00
同步
这个提交包含在:
@@ -239,14 +239,20 @@ function do_something_but_not_too_frequently(min_interval, func) {
|
||||
const now = Date.now();
|
||||
if (!lastInvocationTime || (now - lastInvocationTime) >= min_interval) {
|
||||
lastInvocationTime = now;
|
||||
func.apply(this, args);
|
||||
// 现在就执行
|
||||
setTimeout(() => {
|
||||
func.apply(this, lastArgs);
|
||||
}, 0);
|
||||
} else if (!timeoutID) {
|
||||
// 等一会执行
|
||||
timeoutID = setTimeout(() => {
|
||||
timeoutID = null;
|
||||
lastInvocationTime = Date.now();
|
||||
func.apply(this, lastArgs);
|
||||
}, min_interval - (now - lastInvocationTime));
|
||||
}
|
||||
} else {
|
||||
// 压根不执行
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,7 +264,7 @@ function chatbotContentChanged(attempt = 1, force = false) {
|
||||
}, i === 0 ? 0 : 200);
|
||||
}
|
||||
|
||||
const run_mermaid_render = do_something_but_not_too_frequently(500, function () {
|
||||
const run_mermaid_render = do_something_but_not_too_frequently(1000, function () {
|
||||
const blocks = document.querySelectorAll(`pre.mermaid, diagram-div`);
|
||||
if (blocks.length == 0) { return; }
|
||||
uml("mermaid");
|
||||
|
||||
在新工单中引用
屏蔽一个用户