Quote escape label names when searching to handle spaces in names

This commit is contained in:
Jackson Harper 2023-10-05 15:02:33 +08:00
parent cf2a6b552a
commit 4fea649dcf

View file

@ -408,12 +408,12 @@ import Views
if !selectedLabels.isEmpty {
query.append(" label:")
query.append(selectedLabels.map { $0.name ?? "" }.joined(separator: ","))
query.append(selectedLabels.map { $0.name != nil ? "\"\(String(describing: $0.name))\"" : "" }.joined(separator: ","))
}
if !negatedLabels.isEmpty {
query.append(" !label:")
query.append(negatedLabels.map { $0.name ?? "" }.joined(separator: ","))
query.append(negatedLabels.map { $0.name != nil ? "\"\(String(describing: $0.name))\"" : "" }.joined(separator: ","))
}
print("QUERY: `\(query)`")