diff --git a/app/src/main/java/com/babylon/wallet/android/data/dapp/IncomingRequestRepository.kt b/app/src/main/java/com/babylon/wallet/android/data/dapp/IncomingRequestRepository.kt index 5f7f34f582..734393c53c 100644 --- a/app/src/main/java/com/babylon/wallet/android/data/dapp/IncomingRequestRepository.kt +++ b/app/src/main/java/com/babylon/wallet/android/data/dapp/IncomingRequestRepository.kt @@ -149,23 +149,21 @@ class IncomingRequestRepositoryImpl @Inject constructor( } // Put high priority item below any internal request and mobile connect requests - val topQueueItem = requestQueue.peekFirst() - if (topQueueItem is QueueItem.RequestItem && - (topQueueItem.incomingRequest.isInternal || topQueueItem.incomingRequest.isMobileConnectRequest) - ) { - requestQueue.add(1, QueueItem.HighPriorityScreen) - } else { - requestQueue.addFirst(QueueItem.HighPriorityScreen) - } -// val index = requestQueue.indexOfFirst { -// val item = it as? QueueItem.RequestItem -// item != null && !item.incomingRequest.isInternal && !item.incomingRequest.isMobileConnectRequest -// } -// if (index != -1) { -// requestQueue.add(index, QueueItem.HighPriorityScreen) +// val topQueueItem = requestQueue.peekFirst() +// if (topQueueItem is QueueItem.RequestItem && topQueueItem.incomingRequest.isInternal) { +// requestQueue.add(1, QueueItem.HighPriorityScreen) // } else { // requestQueue.addFirst(QueueItem.HighPriorityScreen) // } + val index = requestQueue.indexOfFirst { + val item = it as? QueueItem.RequestItem + item != null && !item.incomingRequest.isInternal + } + if (index != -1) { + requestQueue.add(index, QueueItem.HighPriorityScreen) + } else { + requestQueue.addFirst(QueueItem.HighPriorityScreen) + } Timber.d("🗂 Temporarily pausing incoming message queue") } } diff --git a/app/src/main/java/com/babylon/wallet/android/presentation/main/MainViewModel.kt b/app/src/main/java/com/babylon/wallet/android/presentation/main/MainViewModel.kt index 4b685d9006..6db1127b8c 100644 --- a/app/src/main/java/com/babylon/wallet/android/presentation/main/MainViewModel.kt +++ b/app/src/main/java/com/babylon/wallet/android/presentation/main/MainViewModel.kt @@ -289,7 +289,7 @@ class MainViewModel @Inject constructor( // if (request.isMobileConnectRequest) { // incomingRequestRepository.addPriorityRequest(request) // } else { - incomingRequestRepository.add(request) + incomingRequestRepository.add(request) // } } }.onFailure { error ->