Skip to content

Commit

Permalink
Merge pull request #1722 from MixinNetwork/bugfix/transfer
Browse files Browse the repository at this point in the history
Show identity number in transfer receiver selector
  • Loading branch information
over140 authored Jan 11, 2025
2 parents 7a207bd + 7ec7c39 commit 86f0ce4
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions Mixin/Service/Storage/Search Result/SearchResult.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,26 @@ extension SearchResult {

static func description(identityNumber: String?, phoneNumber: String?, keyword: String) -> NSAttributedString? {
if let identityNumber = identityNumber, identityNumber.contains(keyword) {
let text = R.string.localizable.contact_mixin_id(identityNumber)
return SearchResult.attributedText(text: text,
textAttributes: SearchResult.normalDescriptionAttributes,
keyword: keyword,
keywordAttributes: SearchResult.highlightedNormalDescriptionAttributes)
SearchResult.attributedText(
text: R.string.localizable.contact_mixin_id(identityNumber),
textAttributes: SearchResult.normalDescriptionAttributes,
keyword: keyword,
keywordAttributes: SearchResult.highlightedNormalDescriptionAttributes
)
} else if let phoneNumber = phoneNumber, phoneNumber.contains(keyword) {
let text = R.string.localizable.search_result_prefix_phone() + phoneNumber
return SearchResult.attributedText(text: text,
textAttributes: SearchResult.normalDescriptionAttributes,
keyword: keyword,
keywordAttributes: SearchResult.highlightedNormalDescriptionAttributes)
SearchResult.attributedText(
text: R.string.localizable.search_result_prefix_phone() + phoneNumber,
textAttributes: SearchResult.normalDescriptionAttributes,
keyword: keyword,
keywordAttributes: SearchResult.highlightedNormalDescriptionAttributes
)
} else if let identityNumber = identityNumber {
NSAttributedString(
string: identityNumber,
attributes: SearchResult.normalDescriptionAttributes
)
} else {
return nil
nil
}
}

Expand Down

0 comments on commit 86f0ce4

Please sign in to comment.