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 @@ - +