mirror of
https://github.com/lil-org/tokenary.git
synced 2025-01-07 14:10:28 +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 {
|
if let id = interactor?.clientId {
|
||||||
self?.peers[id] = peer
|
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?.approveSession(accounts: accounts, chainId: chainId).cauterize()
|
||||||
}
|
}
|
||||||
|
|
||||||
interactor.onDisconnect = { _ in
|
interactor.onDisconnect = { [weak interactor] _ in
|
||||||
// TODO: reconnect when appropriate. should not reconnect when session is killed.
|
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
|
interactor.eth.onSign = { [weak self, weak interactor] (id, payload) in
|
||||||
|
Loading…
Reference in New Issue
Block a user