Fixed a bug where a stale flag was used to determine how to send a push notification
This commit is contained in:
parent
d38a44515d
commit
5659b55eae
|
@ -66,7 +66,6 @@ public final class MessageSender {
|
||||||
) throws -> Promise<Void> {
|
) throws -> Promise<Void> {
|
||||||
let (promise, seal) = Promise<Void>.pending()
|
let (promise, seal) = Promise<Void>.pending()
|
||||||
let userPublicKey: String = getUserHexEncodedPublicKey(db)
|
let userPublicKey: String = getUserHexEncodedPublicKey(db)
|
||||||
let isMainAppActive: Bool = (UserDefaults.sharedLokiProject?[.isMainAppActive]).defaulting(to: false)
|
|
||||||
let messageSendTimestamp: Int64 = SnodeAPI.currentOffsetTimestampMs()
|
let messageSendTimestamp: Int64 = SnodeAPI.currentOffsetTimestampMs()
|
||||||
|
|
||||||
// Set the timestamp, sender and recipient
|
// Set the timestamp, sender and recipient
|
||||||
|
@ -261,6 +260,8 @@ public final class MessageSender {
|
||||||
behaviour: .runOnce,
|
behaviour: .runOnce,
|
||||||
details: NotifyPushServerJob.Details(message: snodeMessage)
|
details: NotifyPushServerJob.Details(message: snodeMessage)
|
||||||
)
|
)
|
||||||
|
let isMainAppActive: Bool = (UserDefaults.sharedLokiProject?[.isMainAppActive])
|
||||||
|
.defaulting(to: false)
|
||||||
|
|
||||||
if isMainAppActive {
|
if isMainAppActive {
|
||||||
JobRunner.add(db, job: job)
|
JobRunner.add(db, job: job)
|
||||||
|
|
Loading…
Reference in New Issue