Updated on 2026-08-14
This commit is contained in:
parent
4882daf1a2
commit
f7475b349e
2 changed files with 11 additions and 5 deletions
|
|
@ -79,7 +79,6 @@ internal class DefaultWcPairUseCase @AssistedInject constructor(
|
|||
}
|
||||
// finish flow if rejected above
|
||||
if (sessionForApprove == null) {
|
||||
analytics.send(WcAnalyticEvents.SessionDisconnected(proposalState.dAppSession.dAppMetaData))
|
||||
sdkDelegate.rejectSession(sdkSessionProposal.proposerPublicKey)
|
||||
return@flow
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import com.tangem.core.ui.message.DialogMessage
|
|||
import com.tangem.core.ui.message.EventMessageAction
|
||||
import com.tangem.core.ui.message.SnackbarMessage
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.domain.qrscanning.models.QrResultSource
|
||||
import com.tangem.domain.qrscanning.models.SourceType
|
||||
import com.tangem.domain.qrscanning.usecases.ListenToQrScanningUseCase
|
||||
import com.tangem.domain.walletconnect.WcAnalyticEvents
|
||||
|
|
@ -65,14 +66,20 @@ internal class WcConnectionsModel @Inject constructor(
|
|||
}
|
||||
|
||||
private fun listenQrUpdates() {
|
||||
listenToQrScanningUseCase(SourceType.WALLET_CONNECT)
|
||||
listenToQrScanningUseCase.listen(SourceType.WALLET_CONNECT)
|
||||
.getOrElse { emptyFlow() }
|
||||
.onEach { wcUrl ->
|
||||
.onEach { result ->
|
||||
val source = when (result.resultSource) {
|
||||
QrResultSource.CLIPBOARD -> WcPairRequest.Source.CLIPBOARD
|
||||
QrResultSource.CAMERA,
|
||||
QrResultSource.GALLERY,
|
||||
-> WcPairRequest.Source.QR
|
||||
}
|
||||
wcPairService.pair(
|
||||
WcPairRequest(
|
||||
userWalletId = params.userWalletId,
|
||||
uri = wcUrl,
|
||||
source = WcPairRequest.Source.QR,
|
||||
uri = result.qrCode,
|
||||
source = source,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue