mirror of
https://github.com/lil-org/tokenary.git
synced 2025-01-05 20:16:25 +03:00
Kill all sessions on app quit
This commit is contained in:
parent
21830909a3
commit
4551f70b18
@ -114,7 +114,11 @@ class Agent: NSObject {
|
||||
alert.addButton(withTitle: "OK")
|
||||
alert.addButton(withTitle: "Cancel")
|
||||
if alert.runModal() == .alertFirstButtonReturn {
|
||||
NSApp.terminate(nil)
|
||||
statusBarItem = nil
|
||||
WalletConnect.shared.killAllSessions()
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(2)) {
|
||||
NSApp.terminate(nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,12 @@ class WalletConnect {
|
||||
interactors.append(interactor)
|
||||
}
|
||||
|
||||
func killAllSessions() {
|
||||
interactors.forEach {
|
||||
$0.killSession().cauterize()
|
||||
}
|
||||
}
|
||||
|
||||
private func configure(interactor: WCInteractor, address: String) {
|
||||
let accounts = [address]
|
||||
let chainId = 1
|
||||
|
Loading…
Reference in New Issue
Block a user