File tree Expand file tree Collapse file tree 1 file changed +6
-13
lines changed
app/src/main/java/com/infomaniak/mail/ui/newMessage Expand file tree Collapse file tree 1 file changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,6 @@ import com.infomaniak.mail.utils.extensions.observeNotNull
44
44
import com.infomaniak.mail.utils.extensions.updateNavigationBarColor
45
45
import dagger.hilt.android.qualifiers.ActivityContext
46
46
import dagger.hilt.android.scopes.FragmentScoped
47
- import kotlinx.coroutines.Dispatchers
48
47
import kotlinx.coroutines.delay
49
48
import kotlinx.coroutines.launch
50
49
import javax.inject.Inject
@@ -231,18 +230,12 @@ class NewMessageAiManager @Inject constructor(
231
230
closeAiPrompt(becauseOfGeneration = true )
232
231
resetAiProposition()
233
232
234
- // TODO: Find out if body is empty
235
- // TODO: Review this part
236
- binding.editor.exportHtml {
237
- viewLifecycleOwner.lifecycleScope.launch(Dispatchers .Main ) {
238
- fragment.safeNavigate(
239
- NewMessageFragmentDirections .actionNewMessageFragmentToAiPropositionFragment(
240
- isSubjectBlank = fragment.isSubjectBlank(),
241
- isBodyBlank = it.isBlank(),
242
- ),
243
- )
244
- }
245
- }
233
+ fragment.safeNavigate(
234
+ NewMessageFragmentDirections .actionNewMessageFragmentToAiPropositionFragment(
235
+ isSubjectBlank = fragment.isSubjectBlank(),
236
+ isBodyBlank = binding.editor.isEmptyFlow.value ? : true ,
237
+ ),
238
+ )
246
239
}
247
240
248
241
fun openAiPrompt () {
You can’t perform that action at this time.
0 commit comments