V45.7b: fix TCP loading loop — _notifyStatus chi fire cb khi connected doi (poller queryStatus 400ms tung reset map + reload track -> LOAD skip vo han)

This commit is contained in:
2026-08-29 22:11:00 +07:00
parent c0fbf29d41
commit 85fdcb16e2
2 changed files with 8 additions and 3 deletions
@@ -17,8 +17,13 @@
/** D10: UI subscribes to bridge connection changes. cb({connected}) or null to clear. */
onStatusChange: function (cb) { this._statusCb = cb; },
_notifyStatus: function (connected) {
this.isBridgeConnected = !!connected;
if (this._statusCb) this._statusCb({ connected: !!connected });
connected = !!connected;
// Loop guard (V45.7): poller queryStatus moi 400ms tung goi cb du connected
// khong doi -> App reset map + reload toan bo track -> mark loading lai ->
// poller lai thay loading -> LOAD skip vo han. Chi fire khi TRANG THAI DOI.
if (this.isBridgeConnected === connected) return;
this.isBridgeConnected = connected;
if (this._statusCb) this._statusCb({ connected: connected });
},
/** Fix C: re-establish bridge routing once audio frames arrive again