diff --git a/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.kt b/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.kt index 6973648afc02..e7c44262f0d9 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.kt @@ -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) } } } diff --git a/WordPress/src/main/java/org/wordpress/android/ui/voicetocontent/VoiceToContentDialogFragment.kt b/WordPress/src/main/java/org/wordpress/android/ui/voicetocontent/VoiceToContentDialogFragment.kt index 5807b5d34436..c32a850d0145 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/voicetocontent/VoiceToContentDialogFragment.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/voicetocontent/VoiceToContentDialogFragment.kt @@ -83,6 +83,7 @@ class VoiceToContentDialogFragment : BottomSheetDialogFragment() { } override fun onSlide(bottomSheet: View, slideOffset: Float) { + // no op } })