Include spoiler text count when applicable (#281)
This commit is contained in:
parent
29f6bf0579
commit
0ad5f17b5a
|
@ -201,7 +201,7 @@ struct StatusEditorAccessoryView: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
private var characterCountView: some View {
|
private var characterCountView: some View {
|
||||||
Text("\((currentInstance.instance?.configuration?.statuses.maxCharacters ?? 500) - viewModel.statusText.string.utf16.count)")
|
Text("\((currentInstance.instance?.configuration?.statuses.maxCharacters ?? 500) - viewModel.statusText.string.utf16.count - viewModel.spoilerTextCount)")
|
||||||
.foregroundColor(.gray)
|
.foregroundColor(.gray)
|
||||||
.font(.scaledCallout)
|
.font(.scaledCallout)
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,10 @@ public class StatusEditorViewModel: ObservableObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var spoilerTextCount: Int {
|
||||||
|
spoilerOn ? spoilerText.utf16.count : 0
|
||||||
|
}
|
||||||
|
|
||||||
@Published var backupStatusText: NSAttributedString?
|
@Published var backupStatusText: NSAttributedString?
|
||||||
|
|
||||||
@Published var showPoll: Bool = false
|
@Published var showPoll: Bool = false
|
||||||
|
|
Loading…
Reference in New Issue