mirror of https://github.com/oxen-io/session-ios
replying to notification marks thread as read
parent
1e0504e8ff
commit
6c08f98fbb
@ -0,0 +1,20 @@
|
|||||||
|
//
|
||||||
|
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
import PromiseKit
|
||||||
|
|
||||||
|
public extension YapDatabaseConnection {
|
||||||
|
|
||||||
|
@objc
|
||||||
|
func readWritePromise(_ block: @escaping (YapDatabaseReadWriteTransaction) -> Void) -> AnyPromise {
|
||||||
|
return AnyPromise(readWritePromise(block) as Promise<Void>)
|
||||||
|
}
|
||||||
|
|
||||||
|
func readWritePromise(_ block: @escaping (YapDatabaseReadWriteTransaction) -> Void) -> Promise<Void> {
|
||||||
|
return Promise { resolver in
|
||||||
|
self.asyncReadWrite(block, completionBlock: resolver.fulfill)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue