Skip to content

Commit

Permalink
Merge pull request #1445 from WalletConnect/siwe_fallback/disconnect_…
Browse files Browse the repository at this point in the history
…when_closing_dialog

Show error when disconnecting without Internet
  • Loading branch information
jakubuid authored Jul 15, 2024
2 parents c216c44 + e20b89d commit 67bd283
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 67bd283

Please sign in to comment.