Skip to content

Commit

Permalink
Closes mozilla-mobile#21388: Only parse clipboard content when search…
Browse files Browse the repository at this point in the history
… fragment is attached
  • Loading branch information
csadilek committed Sep 20, 2021
1 parent d4ce149 commit 95f7dcc
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,9 @@ class SearchDialogFragment : AppCompatDialogFragment(), UserInteractionHandler {
// We delay querying the clipboard by posting this code to the main thread message queue,
// because ClipboardManager will return null if the does app not have input focus yet.
lifecycleScope.launch(Dispatchers.Cached) {
store.dispatch(
SearchFragmentAction.UpdateClipboardUrl(
requireContext().components.clipboardHandler.url
)
)
context?.components?.clipboardHandler?.url?.let { clipboardUrl ->
store.dispatch(SearchFragmentAction.UpdateClipboardUrl(clipboardUrl))
}
}
}
}
Expand Down

0 comments on commit 95f7dcc

Please sign in to comment.