fix user notifications from old events immediately shown on install and login

Changelog-Fixed: Fix user notifications from old events immediately shown on install and login
Closes: #1106
This commit is contained in:
Bryan Montz authored and William Casarin committed 2023-05-08 11:02:12 -07:00
1 parent 9847f12c95
commit 43017828e2
2 files changed
+15 -1

No files matched your search

+5
View File
@@ -278,6 +278,11 @@ class NostrEvent: Codable, Identifiable, CustomStringConvertible, Equatable, Has
func sign(privkey: String) {
self.sig = sign_event(privkey: privkey, ev: self)
}
var age: TimeInterval {
let event_date = Date(timeIntervalSince1970: TimeInterval(created_at))
return Date.now.timeIntervalSince(event_date)
}
}
func sign_event(privkey: String, ev: NostrEvent) -> String {