mirror of
https://github.com/lil-org/tokenary.git
synced 2024-12-12 12:33:42 +03:00
Alpha reconnecting to WC
This commit is contained in:
parent
aa425abcbd
commit
983c62f865
@ -57,11 +57,17 @@ class WalletConnect {
|
||||
if let id = interactor?.clientId {
|
||||
self?.peers[id] = peer
|
||||
}
|
||||
if let session = interactor?.session {
|
||||
WCSessionStore.store(session, peerId: peerParam.peerId, peerMeta: peer)
|
||||
// TODO: store session if it is not already stored
|
||||
}
|
||||
interactor?.approveSession(accounts: accounts, chainId: chainId).cauterize()
|
||||
}
|
||||
|
||||
interactor.onDisconnect = { _ in
|
||||
// TODO: reconnect when appropriate. should not reconnect when session is killed.
|
||||
interactor.onDisconnect = { [weak interactor] _ in
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(10)) {
|
||||
interactor?.resume() // TODO: reconnect when appropriate. should not reconnect when session is killed.
|
||||
}
|
||||
}
|
||||
|
||||
interactor.eth.onSign = { [weak self, weak interactor] (id, payload) in
|
||||
|
Loading…
Reference in New Issue
Block a user