From af1af6ba78c07d846b3b16866513d4104c87c2d8 Mon Sep 17 00:00:00 2001 From: MariiaNebesnova Date: Fri, 28 Jul 2023 17:07:03 +0300 Subject: [PATCH] clean up redundant context updates --- src/features/onboarding/utils/tourSteps.tsx | 1 - src/features/onboarding/utils/useOnboardingRef.ts | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/features/onboarding/utils/tourSteps.tsx b/src/features/onboarding/utils/tourSteps.tsx index a9940130..f72f902b 100644 --- a/src/features/onboarding/utils/tourSteps.tsx +++ b/src/features/onboarding/utils/tourSteps.tsx @@ -176,7 +176,6 @@ export const createPOSteps = (refs: Record) => [ ]; export const addLocatorsSteps = (refs: Record, isCustomLocatorFlow: boolean) => { - return [ customLocator(refs, isCustomLocatorFlow), isCustomLocatorFlow ? createCustomLocator(refs) : contextMenu(refs), diff --git a/src/features/onboarding/utils/useOnboardingRef.ts b/src/features/onboarding/utils/useOnboardingRef.ts index b9f3e65d..240be0e5 100644 --- a/src/features/onboarding/utils/useOnboardingRef.ts +++ b/src/features/onboarding/utils/useOnboardingRef.ts @@ -24,8 +24,8 @@ export const useOnBoardingRef = ( refName === OnbrdStep.EditLocator && isCustomLocatorFlow && ref.current ? { current: ref.current.closest(".ant-modal-content") } : ref; - (!isSkipHook && !isRedundantStep) && addRef(refName, _ref, onClickNext, onClickPrev); + !isSkipHook && !isRedundantStep && addRef(refName, _ref, onClickNext, onClickPrev); }, [ref, isFirstLocatorChecked]); - return (!isSkipHook && !isRedundantStep) ? ref : null; + return !isSkipHook && !isRedundantStep ? ref : null; };