mirror of
https://github.com/lil-org/tokenary.git
synced 2024-11-30 13:02:49 +03:00
Support removing request from ExtensionBridge
This commit is contained in:
parent
257e75d47c
commit
63511d3b65
@ -25,7 +25,7 @@ struct ExtensionBridge {
|
||||
|
||||
static func hasRequest(id: Int) -> Bool {
|
||||
if initiatedRequests.contains(id) {
|
||||
initiatedRequests.remove(id)
|
||||
removeRequest(id: id)
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
@ -36,6 +36,10 @@ struct ExtensionBridge {
|
||||
defaults?.set(response.json, forKey: key(id: response.id))
|
||||
}
|
||||
|
||||
static func removeRequest(id: Int) {
|
||||
initiatedRequests.remove(id)
|
||||
}
|
||||
|
||||
static func removeResponse(id: Int) {
|
||||
let key = key(id: id)
|
||||
defaults?.removeObject(forKey: key)
|
||||
|
Loading…
Reference in New Issue
Block a user