Skip to content

Commit 321fddf

Browse files
committed
Remove TODO
1 parent 3c2e255 commit 321fddf

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

vector/src/main/java/im/vector/app/features/home/room/detail/composer/MessageComposerFragment.kt

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,6 @@ class MessageComposerFragment : VectorBaseFragment<FragmentComposerBinding>(), A
437437

438438
private fun renderVoiceMessageMode(content: String) {
439439
ContentAttachmentData.fromJsonString(content)?.let { audioAttachmentData ->
440-
// TODO: review this behaviour
441-
// views.voiceMessageRecorderView.isVisible = true
442440
messageComposerViewModel.handle(MessageComposerAction.InitializeVoiceRecorder(audioAttachmentData))
443441
}
444442
}
@@ -595,17 +593,6 @@ class MessageComposerFragment : VectorBaseFragment<FragmentComposerBinding>(), A
595593
}
596594
}
597595

598-
/**
599-
* Returns the root thread event if we are in a thread room, otherwise returns null.
600-
*/
601-
fun getRootThreadEventId(): String? = withState(timelineViewModel) { it.rootThreadEventId }
602-
603-
/**
604-
* Returns true if the current room is a Thread room, false otherwise.
605-
*/
606-
private fun isThreadTimeLine(): Boolean = withState(timelineViewModel) { it.isThreadTimeline() }
607-
608-
609596
// AttachmentsHelper.Callback
610597
override fun onContentAttachmentsReady(attachments: List<ContentAttachmentData>) {
611598
val grouped = attachments.toGroupedContentAttachmentData()
@@ -787,6 +774,16 @@ class MessageComposerFragment : VectorBaseFragment<FragmentComposerBinding>(), A
787774
return displayName
788775
}
789776

777+
/**
778+
* Returns the root thread event if we are in a thread room, otherwise returns null.
779+
*/
780+
fun getRootThreadEventId(): String? = withState(timelineViewModel) { it.rootThreadEventId }
781+
782+
/**
783+
* Returns true if the current room is a Thread room, false otherwise.
784+
*/
785+
private fun isThreadTimeLine(): Boolean = withState(timelineViewModel) { it.isThreadTimeline() }
786+
790787
/** Set whether the keyboard should disable personalized learning. */
791788
@RequiresApi(Build.VERSION_CODES.O)
792789
private fun EditText.setUseIncognitoKeyboard(useIncognitoKeyboard: Boolean) {

vector/src/main/java/im/vector/app/features/home/room/detail/composer/voice/VoiceRecorderFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ class VoiceRecorderFragment : VectorBaseFragment<FragmentVoiceRecorderBinding>()
8888
override fun invalidate() = withState(timelineViewModel, messageComposerViewModel) { mainState, messageComposerState ->
8989
if (mainState.tombstoneEvent != null) return@withState
9090

91+
val hasVoiceDraft = messageComposerState.voiceRecordingUiState is VoiceMessageRecorderView.RecordingUiState.Draft
9192
with(views.root) {
92-
isVisible = messageComposerState.isVoiceMessageRecorderVisible
93+
isVisible = messageComposerState.isVoiceMessageRecorderVisible || hasVoiceDraft
9394
render(messageComposerState.voiceRecordingUiState)
9495
}
9596
}
@@ -188,5 +189,4 @@ class VoiceRecorderFragment : VectorBaseFragment<FragmentVoiceRecorderBinding>()
188189
* Returns the root thread event if we are in a thread room, otherwise returns null.
189190
*/
190191
fun getRootThreadEventId(): String? = withState(timelineViewModel) { it.rootThreadEventId }
191-
192192
}

0 commit comments

Comments
 (0)