Skip to content

Commit 9ca6df8

Browse files
committed
Reset toolbar nav CD on default toolbar and re-check fire dialog tag after suspend
applyDefaultToolbar now clears navigationContentDescription so the back arrow doesn't keep announcing "Exit selection mode" to screen readers after leaving select mode — that CD is only set by applySelectModeToolbar on the same toolbar instance. renderConfirmation re-checks the fragment tag after createFireDialog returns. The outer tag check is synchronous, but createFireDialog is suspending, so two near-simultaneous emissions could both pass the outer guard and race to show the dialog under the same tag. The post-suspend check serialises on show().
1 parent 0d9484c commit 9ca6df8

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

duckchat/duckchat-impl/src/main/java/com/duckduckgo/duckchat/impl/history/ChatHistoryFragment.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ class ChatHistoryFragment : DuckDuckGoFragment(R.layout.fragment_chat_history) {
164164

165165
private fun applyDefaultToolbar() {
166166
binding.toolbar.setNavigationIcon(com.duckduckgo.mobile.android.R.drawable.ic_arrow_left_24)
167+
binding.toolbar.navigationContentDescription = null
167168
binding.toolbar.setNavigationOnClickListener { requireActivity().onBackPressedDispatcher.onBackPressed() }
168169
binding.toolbar.setTitle(R.string.duck_ai_chat_history_title)
169170
binding.toolbar.menu.findItem(R.id.chat_history_action_search)?.isVisible = true
@@ -214,6 +215,7 @@ class ChatHistoryFragment : DuckDuckGoFragment(R.layout.fragment_chat_history) {
214215
val dialog = fireDialogProvider.createFireDialog(
215216
FireDialogProvider.FireDialogOrigin.ChatHistory(selectedChatUrls = selectedChatUrls),
216217
)
218+
if (childFragmentManager.findFragmentByTag(FIRE_DIALOG_TAG) != null) return@launch
217219
dialog.show(childFragmentManager, FIRE_DIALOG_TAG)
218220
}
219221
}

0 commit comments

Comments
 (0)