mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-android.git
synced 2026-07-22 12:35:49 +00:00
fix: don't show perpetual "Connecting" for Tron chains in Networks list
Real user reported Tron stuck showing "Connecting..." forever in the Networks screen after the ChainRegistry fix (which correctly skips creating a ChainConnection for Tron, since TronGrid is a plain REST API, not WSS). NetworkListAdapterItemFactory.getConnectingState() rendered every non-Connected state (including the Disconnected default a missing connection pool entry falls back to) as "Connecting" with an indefinite shimmer - there was no way to distinguish "never had a connection to begin with" from "still negotiating one". Tron doesn't have a meaningful WS connection state at all (its actual balance/transfer operations poll TronGridApi directly, confirmed independent of ChainConnection), so there's nothing correct to show here - treat it the same as the already-existing isDisabled early return (no status badge) rather than defaulting into the generic "still connecting" UI.
This commit is contained in:
+6
@@ -61,6 +61,12 @@ class RealNetworkListAdapterItemFactory(
|
||||
private fun getConnectingState(network: NetworkState): ConnectionStateModel? {
|
||||
if (network.chain.isDisabled) return null
|
||||
|
||||
// Tron chains never get a ChainConnection/SocketService (TronGrid is a plain REST API, not
|
||||
// WSS JSON-RPC - see ChainRegistry.registerConnection()), so connectionState is always the
|
||||
// Disconnected default here, never Connected. Treat that as "nothing to show" rather than
|
||||
// falling into the generic "Connecting" state below, which would otherwise spin forever.
|
||||
if (network.chain.isTronBased) return null
|
||||
|
||||
return when (network.connectionState) {
|
||||
is SocketStateMachine.State.Connected -> null
|
||||
|
||||
|
||||
Reference in New Issue
Block a user