From 31a748ac6c8bb6906543f742cf94e96b52e771fd Mon Sep 17 00:00:00 2001 From: Jonathan Almeida Date: Wed, 8 Feb 2023 16:06:38 -0500 Subject: [PATCH] [fenix] Fix breaking APIs in SearchUseCases --- .../java/org/mozilla/fenix/HomeActivity.kt | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/HomeActivity.kt b/app/src/main/java/org/mozilla/fenix/HomeActivity.kt index 6da4d1c6a5..4a4f8fd10e 100644 --- a/app/src/main/java/org/mozilla/fenix/HomeActivity.kt +++ b/app/src/main/java/org/mozilla/fenix/HomeActivity.kt @@ -994,14 +994,17 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity { } } else { if (newTab) { - components.useCases.searchUseCases.newTabSearch - .invoke( - searchTermOrURL, - SessionState.Source.Internal.UserEntered, - true, - mode.isPrivate, - searchEngine = engine, - ) + val searchUseCase = if (mode.isPrivate) { + components.useCases.searchUseCases.newPrivateTabSearch + } else { + components.useCases.searchUseCases.newTabSearch + } + searchUseCase.invoke( + searchTermOrURL, + SessionState.Source.Internal.UserEntered, + true, + searchEngine = engine, + ) } else { components.useCases.searchUseCases.defaultSearch.invoke(searchTermOrURL, engine) }