From 7f5098b6b850a607f19058757bbd19377f40e7e1 Mon Sep 17 00:00:00 2001 From: Puneet Lath Date: Thu, 12 Dec 2024 16:15:10 -0500 Subject: [PATCH 1/2] Reroute to search page for nudge --- src/hooks/useOnboardingFlow.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hooks/useOnboardingFlow.ts b/src/hooks/useOnboardingFlow.ts index 3a821dc44caf..342c9ebb6c01 100644 --- a/src/hooks/useOnboardingFlow.ts +++ b/src/hooks/useOnboardingFlow.ts @@ -8,6 +8,7 @@ import * as OnboardingFlow from '@userActions/Welcome/OnboardingFlow'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue'; +import * as SearchQueryUtils from '@libs/SearchQueryUtils'; /** * Hook to handle redirection to the onboarding flow based on the user's onboarding status @@ -37,6 +38,9 @@ function useOnboardingFlowRouter() { } if (hasBeenAddedToNudgeMigration && !dismissedProductTraining?.migratedUserWelcomeModal && Permissions.shouldShowProductTrainingElements(allBetas)) { + const defaultCannedQuery = SearchQueryUtils.buildCannedSearchQuery(); + const query = defaultCannedQuery; + Navigation.navigate(ROUTES.SEARCH_CENTRAL_PANE.getRoute({query})); Navigation.navigate(ROUTES.MIGRATED_USER_WELCOME_MODAL); return; } From f93814bd520967cd7a2469da1c4230bf46dabbc8 Mon Sep 17 00:00:00 2001 From: Puneet Lath Date: Thu, 12 Dec 2024 17:36:56 -0500 Subject: [PATCH 2/2] Prettier --- src/hooks/useOnboardingFlow.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useOnboardingFlow.ts b/src/hooks/useOnboardingFlow.ts index 342c9ebb6c01..84ac886cf88b 100644 --- a/src/hooks/useOnboardingFlow.ts +++ b/src/hooks/useOnboardingFlow.ts @@ -4,11 +4,11 @@ import {useOnyx} from 'react-native-onyx'; import Navigation from '@libs/Navigation/Navigation'; import {hasCompletedGuidedSetupFlowSelector, tryNewDotOnyxSelector} from '@libs/onboardingSelectors'; import Permissions from '@libs/Permissions'; +import * as SearchQueryUtils from '@libs/SearchQueryUtils'; import * as OnboardingFlow from '@userActions/Welcome/OnboardingFlow'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue'; -import * as SearchQueryUtils from '@libs/SearchQueryUtils'; /** * Hook to handle redirection to the onboarding flow based on the user's onboarding status