Revert "Fix mentions not working in middle of new note"
This breaks other things, the autocomplete doesn't go away after tag
selection now
This reverts commit 1e7d9a6373.
This commit is contained in:
@@ -170,20 +170,24 @@ struct PostView: View {
|
||||
}
|
||||
|
||||
func get_searching_string(_ post: String) -> String? {
|
||||
guard let handle = post.components(separatedBy: .whitespacesAndNewlines).first(where: {$0.first == "@"}) else {
|
||||
guard let last_word = post.components(separatedBy: .whitespacesAndNewlines).last else {
|
||||
return nil
|
||||
}
|
||||
|
||||
guard handle.count >= 2 else {
|
||||
guard last_word.count >= 2 else {
|
||||
return nil
|
||||
}
|
||||
|
||||
guard last_word.first! == "@" else {
|
||||
return nil
|
||||
}
|
||||
|
||||
// don't include @npub... strings
|
||||
guard handle.count != 64 else {
|
||||
guard last_word.count != 64 else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return String(handle.dropFirst())
|
||||
return String(last_word.dropFirst())
|
||||
}
|
||||
|
||||
struct PostView_Previews: PreviewProvider {
|
||||
|
||||
Reference in New Issue
Block a user