Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -840,9 +840,11 @@ open class BrowserActivity : DuckDuckGoActivity() {
val fragment = duckAiFragment
if (fragment?.isVisible == true) {
animateDuckAiFragmentOut {
val transaction = supportFragmentManager.beginTransaction()
transaction.hide(fragment)
transaction.commit()
if (!supportFragmentManager.isStateSaved) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how exactly that scenario would play out, but shouldn't this be checked before we run any logic in the function? Otherwise, if a state is restored with fragment visible, our local isDuckChatVisible would be set to false already.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs to be checked when the animation completes, if we check it before, the state may have changed by then. Not sure how to deal with that inconsistency.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. Anyway, looks like a quick way to prevent the crash and worst case we'll have a one time issue with keyboard pop-up which will resolve itself either way, so that's not a big deal.

val transaction = supportFragmentManager.beginTransaction()
transaction.hide(fragment)
transaction.commit()
}
}
}
}
Expand Down
Loading