fix: Ensure initial status length calculation includes the content warning (#821)
Previous code set `doOnTextChanged` listener for the content warning *after* the initial value had been set. This meant the initial content warning text was not included when calculating the status' initial length. Fix that by setting the listener before the text is set. Fixes #815
This commit is contained in:
parent
00a2cd32d3
commit
311e45168e
|
@ -396,12 +396,12 @@ class ComposeActivity :
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupContentWarningField(startingContentWarning: String?) {
|
private fun setupContentWarningField(startingContentWarning: String?) {
|
||||||
if (startingContentWarning != null) {
|
|
||||||
binding.composeContentWarningField.setText(startingContentWarning)
|
|
||||||
}
|
|
||||||
binding.composeContentWarningField.doOnTextChanged { newContentWarning, _, _, _ ->
|
binding.composeContentWarningField.doOnTextChanged { newContentWarning, _, _, _ ->
|
||||||
viewModel.onContentWarningChanged(newContentWarning?.toString() ?: "")
|
viewModel.onContentWarningChanged(newContentWarning?.toString() ?: "")
|
||||||
}
|
}
|
||||||
|
if (startingContentWarning != null) {
|
||||||
|
binding.composeContentWarningField.setText(startingContentWarning)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupComposeField(
|
private fun setupComposeField(
|
||||||
|
|
Loading…
Reference in New Issue