From e20b89d5f268cee829312ab5e19953302507d427 Mon Sep 17 00:00:00 2001 From: kubel Date: Mon, 15 Jul 2024 15:39:47 +0200 Subject: [PATCH] Fix no disconnect error feedback --- .../web3/modal/ui/routes/account/AccountViewModel.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/product/web3modal/src/main/kotlin/com/walletconnect/web3/modal/ui/routes/account/AccountViewModel.kt b/product/web3modal/src/main/kotlin/com/walletconnect/web3/modal/ui/routes/account/AccountViewModel.kt index f6ba2e23d..4e7672ae8 100644 --- a/product/web3modal/src/main/kotlin/com/walletconnect/web3/modal/ui/routes/account/AccountViewModel.kt +++ b/product/web3modal/src/main/kotlin/com/walletconnect/web3/modal/ui/routes/account/AccountViewModel.kt @@ -92,11 +92,13 @@ internal class AccountViewModel : ViewModel(), Navigator by NavigatorImpl() { }.flowOn(Dispatchers.IO).catch { logger.error(it) }.stateIn(viewModelScope, started = SharingStarted.Lazily, initialValue = null) fun disconnect() { - closeModal() - web3ModalEngine.disconnect { - showError(it.localizedMessage) - logger.error(it) - } + web3ModalEngine.disconnect( + onSuccess = { closeModal() }, + onError = { + showError(it.localizedMessage) + logger.error(it) + } + ) } fun changeActiveChain(chain: Modal.Model.Chain) = viewModelScope.launch {