mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Avoid race and duplication conditions between local and remote notifications (#848)
* added timestamp control of the local notification * improved the code, and implemented the solution, just needs some testing * sdk bump * UserPreference init with initialValue instead of defaultValue * pr suggestions * changelog * notifications sliding sync view added
This commit is contained in:
@@ -23,6 +23,8 @@ protocol TimelineEventProxyProtocol {
|
||||
var eventID: String { get }
|
||||
|
||||
var senderID: String { get }
|
||||
|
||||
var timestamp: Date { get }
|
||||
}
|
||||
|
||||
final class TimelineEventProxy: TimelineEventProxyProtocol {
|
||||
@@ -43,10 +45,15 @@ final class TimelineEventProxy: TimelineEventProxyProtocol {
|
||||
var type: TimelineEventType? {
|
||||
try? timelineEvent.eventType()
|
||||
}
|
||||
|
||||
var timestamp: Date {
|
||||
Date(timeIntervalSince1970: TimeInterval(timelineEvent.timestamp() / 1000))
|
||||
}
|
||||
}
|
||||
|
||||
struct MockTimelineEventProxy: TimelineEventProxyProtocol {
|
||||
let eventID: String
|
||||
let senderID = ""
|
||||
let type: TimelineEventType? = nil
|
||||
let timestamp = Date()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user