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