Fix composition mention population
This commit is contained in:
parent
ee4c7bafdb
commit
65b95e1510
|
@ -65,7 +65,17 @@ public final class NewStatusViewModel: ObservableObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let inReplyTo = inReplyTo, redraft == nil {
|
if let inReplyTo = inReplyTo, redraft == nil {
|
||||||
compositionViewModel.text = inReplyTo.accountName.appending(" ")
|
var mentions = Set<String>()
|
||||||
|
|
||||||
|
if !inReplyTo.isMine {
|
||||||
|
mentions.insert(inReplyTo.accountName)
|
||||||
|
}
|
||||||
|
|
||||||
|
mentions.formUnion(inReplyTo.mentions.map(\.acct)
|
||||||
|
.filter { $0 != identityContext.identity.account?.username }
|
||||||
|
.map("@".appending))
|
||||||
|
|
||||||
|
compositionViewModel.text = mentions.joined(separator: " ").appending(" ")
|
||||||
}
|
}
|
||||||
|
|
||||||
compositionViewModels = [compositionViewModel]
|
compositionViewModels = [compositionViewModel]
|
||||||
|
|
|
@ -108,6 +108,8 @@ public extension StatusViewModel {
|
||||||
return URL(string: website)
|
return URL(string: website)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var mentions: [Mention] { statusService.status.displayStatus.mentions }
|
||||||
|
|
||||||
var visibility: Status.Visibility { statusService.status.displayStatus.visibility }
|
var visibility: Status.Visibility { statusService.status.displayStatus.visibility }
|
||||||
|
|
||||||
var repliesCount: Int { statusService.status.displayStatus.repliesCount }
|
var repliesCount: Int { statusService.status.displayStatus.repliesCount }
|
||||||
|
|
Loading…
Reference in New Issue