Merge remote-tracking branch 'upstream/master' into change-emoji-component
This commit is contained in:
@@ -97,13 +97,13 @@ class EventCache {
|
||||
// TODO: remove me and change code to use ndb directly
|
||||
private let ndb: Ndb
|
||||
private var events: [NoteId: NostrEvent] = [:]
|
||||
private var replies = ReplyMap()
|
||||
private var cancellable: AnyCancellable?
|
||||
private var image_metadata: [String: ImageMetadataState] = [:] // lowercased URL key
|
||||
private var event_data: [NoteId: EventData] = [:]
|
||||
var replies = ReplyMap()
|
||||
|
||||
//private var thread_latest: [String: Int64]
|
||||
|
||||
|
||||
init(ndb: Ndb) {
|
||||
self.ndb = ndb
|
||||
cancellable = NotificationCenter.default.publisher(
|
||||
@@ -187,7 +187,7 @@ class EventCache {
|
||||
replies.add(id: reply, reply_id: ev.id)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func child_events(event: NostrEvent) -> [NostrEvent] {
|
||||
guard let xs = replies.lookup(event.id) else {
|
||||
return []
|
||||
|
||||
27
damus/Util/Extensions/VectorMath.swift
Normal file
27
damus/Util/Extensions/VectorMath.swift
Normal file
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// VectorMath.swift
|
||||
// damus
|
||||
//
|
||||
// Created by Daniel D’Aquino on 2024-06-17.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
extension CGPoint {
|
||||
/// Summing a vector to a point
|
||||
static func +(lhs: CGPoint, rhs: CGVector) -> CGPoint {
|
||||
return CGPoint(x: lhs.x + rhs.dx, y: lhs.y + rhs.dy)
|
||||
}
|
||||
|
||||
/// Subtracting a vector from a point
|
||||
static func -(lhs: CGPoint, rhs: CGVector) -> CGPoint {
|
||||
return CGPoint(x: lhs.x - rhs.dx, y: lhs.y - rhs.dy)
|
||||
}
|
||||
}
|
||||
|
||||
extension CGVector {
|
||||
/// Multiplying a vector by a scalar
|
||||
static func *(lhs: CGVector, rhs: CGFloat) -> CGVector {
|
||||
return CGVector(dx: lhs.dx * rhs, dy: lhs.dy * rhs)
|
||||
}
|
||||
}
|
||||
@@ -93,7 +93,8 @@ enum Route: Hashable {
|
||||
case .FirstAidSettings(settings: let settings):
|
||||
FirstAidSettingsView(damus_state: damusState, settings: settings)
|
||||
case .Thread(let thread):
|
||||
ThreadView(state: damusState, thread: thread)
|
||||
ChatroomThreadView(damus: damusState, thread: thread)
|
||||
//ThreadView(state: damusState, thread: thread)
|
||||
case .Reposts(let reposts):
|
||||
RepostsView(damus_state: damusState, model: reposts)
|
||||
case .QuoteReposts(let quote_reposts):
|
||||
|
||||
Reference in New Issue
Block a user