[fenix] Closes https://github.com/mozilla-mobile/fenix/issues/21388: Only parse clipboard content when search fragment is attached

pull/600/head
Christian Sadilek 3 years ago
parent 9d6367a607
commit 473f671f1c

@ -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))
}
}
}
}

Loading…
Cancel
Save