mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 20:39:24 +00:00
Address search PR review comments
- Drop the redundant searchService coordinator/view model parameter; derive it from the client proxy. - Rename the globalSearch avatar size to search. - Lift the query observation streams out of their tasks. - Restore the appeared and updateVisibleRange comments. - Use CompoundIcon defaults and a scaledFrame for media previews. - Simplify the result mapping with compactMap(makeResult) and drop unsupported events by returning nil. - Move the preview helpers beneath the previews.
This commit is contained in:
@@ -71,7 +71,7 @@ class SearchServiceProxy: SearchServiceProxyProtocol {
|
||||
for update in updates {
|
||||
switch update {
|
||||
case .append(let values):
|
||||
results.append(contentsOf: values.compactMap { self.makeResult($0) })
|
||||
results.append(contentsOf: values.compactMap(makeResult))
|
||||
case .clear:
|
||||
results.removeAll()
|
||||
case .pushFront(let value):
|
||||
@@ -99,7 +99,7 @@ class SearchServiceProxy: SearchServiceProxyProtocol {
|
||||
case .truncate(let length):
|
||||
results.removeSubrange(Int(length)..<results.count)
|
||||
case .reset(let values):
|
||||
results = values.compactMap { self.makeResult($0) }
|
||||
results = values.compactMap(makeResult)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,10 +128,10 @@ class SearchServiceProxy: SearchServiceProxyProtocol {
|
||||
case .liveLocation:
|
||||
content = .liveLocation
|
||||
default:
|
||||
content = .message(.text(.init(body: L10n.commonUnsupportedEvent)))
|
||||
return nil
|
||||
}
|
||||
default:
|
||||
content = .message(.text(.init(body: L10n.commonUnsupportedEvent)))
|
||||
return nil
|
||||
}
|
||||
|
||||
return SearchServiceResult(roomID: roomID,
|
||||
|
||||
Reference in New Issue
Block a user