From 85fdcb16e2a8e4ad7ccc5033aeb87c1a59c2bd5a Mon Sep 17 00:00:00 2001 From: locphamtran Date: Sat, 29 Aug 2026 22:11:00 +0700 Subject: [PATCH] =?UTF-8?q?V45.7b:=20fix=20TCP=20loading=20loop=20?= =?UTF-8?q?=E2=80=94=20=5FnotifyStatus=20chi=20fire=20cb=20khi=20connected?= =?UTF-8?q?=20doi=20(poller=20queryStatus=20400ms=20tung=20reset=20map=20+?= =?UTF-8?q?=20reload=20track=20->=20LOAD=20skip=20vo=20han)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/static/js/services/nativeBridgeService.js | 9 +++++++-- app/templates/index.html | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/static/js/services/nativeBridgeService.js b/app/static/js/services/nativeBridgeService.js index 968ff05..474fa7c 100644 --- a/app/static/js/services/nativeBridgeService.js +++ b/app/static/js/services/nativeBridgeService.js @@ -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 diff --git a/app/templates/index.html b/app/templates/index.html index 130c83f..2b34d77 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -39,7 +39,7 @@ - +