fix(vat): don't enter fill mode unless call completion is observable
Guard the frappe.call wrapper: only bump the pending counter / set fill mode when the call actually returns a thenable. Otherwise a non-promise return would leave fill mode stuck on and silently stop every recompute. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
9e8732a676
commit
d11e32ac65
|
|
@ -300,9 +300,11 @@ if (!frappe.__vc_call_wrapped) {
|
|||
frappe.call = function (opts) {
|
||||
var m = (opts && opts.method) || (typeof opts === "string" ? opts : "");
|
||||
var fill = VC.re.test(m || "");
|
||||
if (fill) { VC.n++; VC.mode = true; }
|
||||
var ret = _vc_call.apply(this, arguments);
|
||||
// Only enter fill mode if we can also observe completion — otherwise mode would
|
||||
// stick on forever and stop every recompute.
|
||||
if (fill && ret && typeof ret.then === "function") {
|
||||
VC.n++; VC.mode = true;
|
||||
var done = function () {
|
||||
if (--VC.n > 0) return; // other fill calls still running
|
||||
VC.n = 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue