Skip to content

Commit

Permalink
Address detekt issues
Browse files Browse the repository at this point in the history
  • Loading branch information
zwarm committed Jun 15, 2024
1 parent b22898c commit 82c48d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3534,18 +3534,13 @@ class EditPostActivity : LocaleAwareActivity(), EditorFragmentActivity, EditorIm
}

private fun updateVoiceContentIfNeeded() {
// Set the voiceToContent content if it exits and this is a GB Editor fragment - do this only once
val hasVoiceContent = intent.hasExtra(EditPostActivityConstants.EXTRA_VOICE_CONTENT)
if (isNewPost && hasVoiceContent && !isVoiceContentSet) {
editorFragment?.let {
if (it is GutenbergEditorFragment) {
val gutenbergFragment = editorFragment as GutenbergEditorFragment
val content = intent.getStringExtra(EditPostActivityConstants.EXTRA_VOICE_CONTENT)
content?.let {
isVoiceContentSet = true
gutenbergFragment.updateContent(content)
}
}
// Check if voice content exists and this is a new post for a Gutenberg editor fragment
val content = intent.getStringExtra(EditPostActivityConstants.EXTRA_VOICE_CONTENT)
if (isNewPost && content != null && !isVoiceContentSet) {
val gutenbergFragment = editorFragment as? GutenbergEditorFragment
gutenbergFragment?.let {
isVoiceContentSet = true
it.updateContent(content)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class VoiceToContentDialogFragment : BottomSheetDialogFragment() {
}

override fun onSlide(bottomSheet: View, slideOffset: Float) {
// no op
}
})

Expand Down

0 comments on commit 82c48d6

Please sign in to comment.