Skip to content

Commit

Permalink
Remove TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartinesp committed Oct 5, 2022
1 parent 3c2e255 commit 321fddf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,6 @@ class MessageComposerFragment : VectorBaseFragment<FragmentComposerBinding>(), A

private fun renderVoiceMessageMode(content: String) {
ContentAttachmentData.fromJsonString(content)?.let { audioAttachmentData ->
// TODO: review this behaviour
// views.voiceMessageRecorderView.isVisible = true
messageComposerViewModel.handle(MessageComposerAction.InitializeVoiceRecorder(audioAttachmentData))
}
}
Expand Down Expand Up @@ -595,17 +593,6 @@ class MessageComposerFragment : VectorBaseFragment<FragmentComposerBinding>(), A
}
}

/**
* Returns the root thread event if we are in a thread room, otherwise returns null.
*/
fun getRootThreadEventId(): String? = withState(timelineViewModel) { it.rootThreadEventId }

/**
* Returns true if the current room is a Thread room, false otherwise.
*/
private fun isThreadTimeLine(): Boolean = withState(timelineViewModel) { it.isThreadTimeline() }


// AttachmentsHelper.Callback
override fun onContentAttachmentsReady(attachments: List<ContentAttachmentData>) {
val grouped = attachments.toGroupedContentAttachmentData()
Expand Down Expand Up @@ -787,6 +774,16 @@ class MessageComposerFragment : VectorBaseFragment<FragmentComposerBinding>(), A
return displayName
}

/**
* Returns the root thread event if we are in a thread room, otherwise returns null.
*/
fun getRootThreadEventId(): String? = withState(timelineViewModel) { it.rootThreadEventId }

/**
* Returns true if the current room is a Thread room, false otherwise.
*/
private fun isThreadTimeLine(): Boolean = withState(timelineViewModel) { it.isThreadTimeline() }

/** Set whether the keyboard should disable personalized learning. */
@RequiresApi(Build.VERSION_CODES.O)
private fun EditText.setUseIncognitoKeyboard(useIncognitoKeyboard: Boolean) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ class VoiceRecorderFragment : VectorBaseFragment<FragmentVoiceRecorderBinding>()
override fun invalidate() = withState(timelineViewModel, messageComposerViewModel) { mainState, messageComposerState ->
if (mainState.tombstoneEvent != null) return@withState

val hasVoiceDraft = messageComposerState.voiceRecordingUiState is VoiceMessageRecorderView.RecordingUiState.Draft
with(views.root) {
isVisible = messageComposerState.isVoiceMessageRecorderVisible
isVisible = messageComposerState.isVoiceMessageRecorderVisible || hasVoiceDraft
render(messageComposerState.voiceRecordingUiState)
}
}
Expand Down Expand Up @@ -188,5 +189,4 @@ class VoiceRecorderFragment : VectorBaseFragment<FragmentVoiceRecorderBinding>()
* Returns the root thread event if we are in a thread room, otherwise returns null.
*/
fun getRootThreadEventId(): String? = withState(timelineViewModel) { it.rootThreadEventId }

}

0 comments on commit 321fddf

Please sign in to comment.