Skip to content

Commit

Permalink
try running signalR stuff on background thread to see does that stop …
Browse files Browse the repository at this point in the history
…the main thread hanging being reported by sentry
  • Loading branch information
simonmcl committed Jun 5, 2024
1 parent ff20e87 commit cd84f76
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Kukai Mobile/Modules/Account/AccountViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,14 @@ class AccountViewModel: ViewModel, UITableViewDiffableDataSourceHandler {
}

static func setupAccountActivityListener() {
let allWallets = DependencyManager.shared.walletList.addresses()
if DependencyManager.shared.tzktClient.isListening {
DependencyManager.shared.tzktClient.changeAddressToListenForChanges(addresses: allWallets)

} else {
DependencyManager.shared.tzktClient.listenForAccountChanges(addresses: allWallets)
DispatchQueue.global().async {
let allWallets = DependencyManager.shared.walletList.addresses()
if DependencyManager.shared.tzktClient.isListening {
DependencyManager.shared.tzktClient.changeAddressToListenForChanges(addresses: allWallets)

} else {
DependencyManager.shared.tzktClient.listenForAccountChanges(addresses: allWallets)
}
}
}

Expand Down

0 comments on commit cd84f76

Please sign in to comment.