Skip to content

Commit

Permalink
Bug 1646242 - Dispatch FinishEdit action only if UrlInputFragment is …
Browse files Browse the repository at this point in the history
…still attached.
  • Loading branch information
mcarare authored and mergify[bot] committed Mar 20, 2023
1 parent d5d7315 commit 1523b46
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -35,6 +35,7 @@ import org.mozilla.focus.GleanMetrics.SearchWidget
import org.mozilla.focus.R
import org.mozilla.focus.activity.MainActivity
import org.mozilla.focus.databinding.FragmentUrlinputBinding
import org.mozilla.focus.ext.components
import org.mozilla.focus.ext.defaultSearchEngineName
import org.mozilla.focus.ext.hasSearchTerms
import org.mozilla.focus.ext.requireComponents
Expand Down Expand Up @@ -533,7 +534,7 @@ class UrlInputFragment :
// this transaction is committed. To avoid this we commit while allowing a state loss here.
// We do not save any state in this fragment (It's getting destroyed) so this should not be a problem.

requireComponents.appStore.dispatch(AppAction.FinishEdit(tab!!.id))
context?.components?.appStore?.dispatch(AppAction.FinishEdit(tab!!.id))
}

internal fun onCommit(input: String) {
Expand Down

0 comments on commit 1523b46

Please sign in to comment.