mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-22 15:16:36 +00:00
Fix editing status dropping mentions / account name
This commit is contained in:
parent
d05d9fbfff
commit
4fc6944360
1 changed files with 5 additions and 1 deletions
|
@ -158,7 +158,11 @@ public class StatusEditorViewModel: ObservableObject {
|
||||||
self.visibility = visibility
|
self.visibility = visibility
|
||||||
selectedRange = .init(location: statusText.string.utf16.count, length: 0)
|
selectedRange = .init(location: statusText.string.utf16.count, length: 0)
|
||||||
case let .edit(status):
|
case let .edit(status):
|
||||||
statusText = .init(status.content.asMarkdown.asSafeAttributedString)
|
var rawText = NSAttributedString(status.content.asMarkdown.asSafeAttributedString).string
|
||||||
|
for mention in status.mentions {
|
||||||
|
rawText = rawText.replacingOccurrences(of: "@\(mention.username)", with: "@\(mention.acct)")
|
||||||
|
}
|
||||||
|
statusText = .init(string: rawText)
|
||||||
selectedRange = .init(location: statusText.string.utf16.count, length: 0)
|
selectedRange = .init(location: statusText.string.utf16.count, length: 0)
|
||||||
spoilerOn = !status.spoilerText.isEmpty
|
spoilerOn = !status.spoilerText.isEmpty
|
||||||
spoilerText = status.spoilerText
|
spoilerText = status.spoilerText
|
||||||
|
|
Loading…
Reference in a new issue