Skip to content

Commit cb3b198

Browse files
committed
Merge branch 'main' into WAL-1589-remove-spaceseven
2 parents 98c5252 + a56b72e commit cb3b198

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
### Fixed
11+
12+
- Not responding to WalletConnect requests after switching wallets
13+
814
## [1.18.0] - 2026-02-11
915

1016
### Added

app/src/main/java/com/concordium/wallet/ui/walletconnect/WalletConnectViewModel.kt

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import kotlinx.coroutines.flow.Flow
3131
import kotlinx.coroutines.flow.MutableSharedFlow
3232
import kotlinx.coroutines.flow.MutableStateFlow
3333
import kotlinx.coroutines.flow.combine
34-
import kotlinx.coroutines.flow.first
3534
import kotlinx.coroutines.launch
3635
import kotlinx.coroutines.runBlocking
3736
import org.koin.core.component.KoinComponent
@@ -110,7 +109,6 @@ private constructor(
110109
private lateinit var sessionRequestAccount: Account
111110
private lateinit var sessionRequestAppMetadata: AppMetadata
112111
private val handledRequests = mutableSetOf<Long>()
113-
private val connectionAvailabilityFlow = MutableStateFlow(false)
114112

115113
enum class ProofProvableState {
116114
Provable,
@@ -357,11 +355,6 @@ private constructor(
357355
}
358356
}
359357

360-
override fun onConnectionStateChange(state: Sign.Model.ConnectionState) {
361-
defaultWalletDelegate.onConnectionStateChange(state)
362-
connectionAvailabilityFlow.tryEmit(state.isAvailable)
363-
}
364-
365358
override fun onSessionProposal(
366359
sessionProposal: Sign.Model.SessionProposal,
367360
verifyContext: Sign.Model.VerifyContext,
@@ -1029,7 +1022,7 @@ private constructor(
10291022

10301023
State.WaitingForSessionProposal,
10311024
State.WaitingForSessionRequest,
1032-
-> {
1025+
-> {
10331026
mutableStateFlow.tryEmit(State.Idle)
10341027
}
10351028

@@ -1098,17 +1091,14 @@ private constructor(
10981091
private fun respondSuccess(result: String) = viewModelScope.launch {
10991092
handledRequests += sessionRequestId
11001093

1101-
// Await the connection.
1102-
connectionAvailabilityFlow.first { it }
1103-
11041094
SignClient.respond(
11051095
Sign.Params.Response(
11061096
sessionTopic = sessionRequestTopic,
11071097
jsonRpcResponse = Sign.Model.JsonRpcResponse.JsonRpcResult(
11081098
id = sessionRequestId,
11091099
result = result,
11101100
)
1111-
)
1101+
),
11121102
) { error ->
11131103
Log.e("failed_responding_success", error.throwable)
11141104

@@ -1127,9 +1117,6 @@ private constructor(
11271117
) = viewModelScope.launch {
11281118
handledRequests += sessionRequestId
11291119

1130-
// Await the connection.
1131-
connectionAvailabilityFlow.first { it }
1132-
11331120
SignClient.respond(
11341121
Sign.Params.Response(
11351122
sessionTopic = sessionRequestTopic,

0 commit comments

Comments
 (0)