Skip to content

Commit

Permalink
Remove beta
Browse files Browse the repository at this point in the history
  • Loading branch information
ishpaul777 committed Dec 12, 2024
1 parent a8c5fab commit 490bcf4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
6 changes: 2 additions & 4 deletions src/components/ProductTrainingContext/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import {hasCompletedGuidedSetupFlowSelector} from '@libs/onboardingSelectors';
import Permissions from '@libs/Permissions';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type ChildrenProps from '@src/types/utils/ChildrenProps';
Expand All @@ -35,7 +34,6 @@ function ProductTrainingContextProvider({children}: ChildrenProps) {
selector: hasCompletedGuidedSetupFlowSelector,
});
const [dismissedProductTraining] = useOnyx(ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING);
const [allBetas] = useOnyx(ONYXKEYS.BETAS);
const {shouldUseNarrowLayout} = useResponsiveLayout();

const [activeTooltips, setActiveTooltips] = useState<Set<ProductTrainingTooltipName>>(new Set());
Expand Down Expand Up @@ -76,7 +74,7 @@ function ProductTrainingContextProvider({children}: ChildrenProps) {
(tooltipName: ProductTrainingTooltipName) => {
const isDismissed = !!dismissedProductTraining?.[tooltipName];

if (isDismissed || !Permissions.shouldShowProductTrainingElements(allBetas)) {
if (isDismissed) {
return false;
}
const tooltipConfig = TOOLTIPS[tooltipName];
Expand All @@ -94,7 +92,7 @@ function ProductTrainingContextProvider({children}: ChildrenProps) {
shouldUseNarrowLayout,
});
},
[allBetas, dismissedProductTraining, hasBeenAddedToNudgeMigration, isOnboardingCompleted, shouldUseNarrowLayout],
[dismissedProductTraining, hasBeenAddedToNudgeMigration, isOnboardingCompleted, shouldUseNarrowLayout],
);

const registerTooltip = useCallback(
Expand Down
8 changes: 2 additions & 6 deletions src/hooks/useOnboardingFlow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {NativeModules} from 'react-native';
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 OnboardingFlow from '@userActions/Welcome/OnboardingFlow';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
Expand All @@ -26,17 +25,16 @@ function useOnboardingFlowRouter() {
const [dismissedProductTraining, dismissedProductTrainingMetadata] = useOnyx(ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING);

const [isSingleNewDotEntry, isSingleNewDotEntryMetadata] = useOnyx(ONYXKEYS.IS_SINGLE_NEW_DOT_ENTRY);
const [allBetas, allBetasMetadata] = useOnyx(ONYXKEYS.BETAS);
useEffect(() => {
if (isLoadingOnyxValue(isOnboardingCompletedMetadata, tryNewDotdMetadata, dismissedProductTrainingMetadata, allBetasMetadata)) {
if (isLoadingOnyxValue(isOnboardingCompletedMetadata, tryNewDotdMetadata, dismissedProductTrainingMetadata)) {
return;
}

if (NativeModules.HybridAppModule && isLoadingOnyxValue(isSingleNewDotEntryMetadata)) {
return;
}

if (hasBeenAddedToNudgeMigration && !dismissedProductTraining?.migratedUserWelcomeModal && Permissions.shouldShowProductTrainingElements(allBetas)) {
if (hasBeenAddedToNudgeMigration && !dismissedProductTraining?.migratedUserWelcomeModal) {
Navigation.navigate(ROUTES.MIGRATED_USER_WELCOME_MODAL);
return;
}
Expand Down Expand Up @@ -74,8 +72,6 @@ function useOnboardingFlowRouter() {
dismissedProductTrainingMetadata,
dismissedProductTraining?.migratedUserWelcomeModal,
dismissedProductTraining,
allBetasMetadata,
allBetas,
]);

return {isOnboardingCompleted, isHybridAppOnboardingCompleted};
Expand Down
6 changes: 0 additions & 6 deletions src/libs/Permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ function canUsePerDiem(betas: OnyxEntry<Beta[]>): boolean {
return !!betas?.includes(CONST.BETAS.PER_DIEM) || canUseAllBetas(betas);
}

// TEMPORARY BETA TO HIDE PRODUCT TRAINING TOOLTIP AND MIGRATE USER WELCOME MODAL
function shouldShowProductTrainingElements(betas: OnyxEntry<Beta[]>): boolean {
return !!betas?.includes(CONST.BETAS.PRODUCT_TRAINING) || canUseAllBetas(betas);
}

/**
* Link previews are temporarily disabled.
*/
Expand All @@ -55,5 +50,4 @@ export default {
canUseCombinedTrackSubmit,
canUseCategoryAndTagApprovers,
canUsePerDiem,
shouldShowProductTrainingElements,
};

0 comments on commit 490bcf4

Please sign in to comment.