Skip to content

Commit 109b1c2

Browse files
committed
fix changed files esLint
1 parent c42c335 commit 109b1c2

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

src/components/Form/FormProvider.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ function FormProvider(
106106
}: FormProviderProps,
107107
forwardedRef: ForwardedRef<FormRef>,
108108
) {
109-
const [network] = useOnyx(ONYXKEYS.NETWORK);
110-
const [formState] = useOnyx<OnyxFormKey, Form>(`${formID}`);
111-
const [draftValues] = useOnyx<OnyxFormDraftKey, Form>(`${formID}Draft`);
109+
const [network] = useOnyx(ONYXKEYS.NETWORK, {canBeMissing: true});
110+
const [formState] = useOnyx<OnyxFormKey, Form>(`${formID}`, {canBeMissing: true});
111+
const [draftValues] = useOnyx<OnyxFormDraftKey, Form>(`${formID}Draft`, {canBeMissing: true});
112112
const {preferredLocale, translate} = useLocalize();
113113
const inputRefs = useRef<InputRefs>({});
114114
const touchedInputs = useRef<Record<string, boolean>>({});

src/components/Form/FormWrapper.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function FormWrapper({
9191
const formRef = useRef<RNScrollView>(null);
9292
const formContentRef = useRef<View>(null);
9393

94-
const [formState] = useOnyx<OnyxFormKey, Form>(`${formID}`);
94+
const [formState] = useOnyx<OnyxFormKey, Form>(`${formID}`, {canBeMissing: true});
9595

9696
const errorMessage = useMemo(() => (formState ? getLatestErrorMessage(formState) : undefined), [formState]);
9797

src/components/ValidateCodeActionModal/ValidateCodeForm/BaseValidateCodeForm.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ function BaseValidateCodeForm({
108108
const [formError, setFormError] = useState<ValidateCodeFormError>({});
109109
const [validateCode, setValidateCode] = useState('');
110110
const inputValidateCodeRef = useRef<MagicCodeInputHandle>(null);
111-
const [account = {}] = useOnyx(ONYXKEYS.ACCOUNT);
111+
const [account = {}] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: true});
112112
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- nullish coalescing doesn't achieve the same result in this case
113113
const shouldDisableResendValidateCode = !!isOffline || account?.isLoading;
114114
const focusTimeoutRef = useRef<NodeJS.Timeout | null>(null);

src/libs/Navigation/AppNavigator/Navigators/OnboardingModalNavigator.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function OnboardingModalNavigator() {
3838
const styles = useThemeStyles();
3939
const {onboardingIsMediumOrLargerScreenWidth} = useResponsiveLayout();
4040
const outerViewRef = React.useRef<View>(null);
41-
const [accountID] = useOnyx(ONYXKEYS.SESSION, {selector: (session) => session?.accountID ?? CONST.DEFAULT_NUMBER_ID});
41+
const [accountID] = useOnyx(ONYXKEYS.SESSION, {selector: (session) => session?.accountID ?? CONST.DEFAULT_NUMBER_ID, canBeMissing: true});
4242

4343
// Publish a sign_up event when we start the onboarding flow. This should track basic sign ups
4444
// as well as Google and Apple SSO.

src/pages/OnboardingWorkEmail/BaseOnboardingWorkEmail.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ type Item = {
4242
function BaseOnboardingWorkEmail({shouldUseNativeStyles}: BaseOnboardingWorkEmailProps) {
4343
const styles = useThemeStyles();
4444
const {translate} = useLocalize();
45-
const [onboardingValues] = useOnyx(ONYXKEYS.NVP_ONBOARDING);
46-
const [formValue] = useOnyx(ONYXKEYS.FORMS.ONBOARDING_WORK_EMAIL_FORM);
45+
const [onboardingValues] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {canBeMissing: true});
46+
const [formValue] = useOnyx(ONYXKEYS.FORMS.ONBOARDING_WORK_EMAIL_FORM, {canBeMissing: true});
4747
const workEmail = formValue?.[INPUT_IDS.ONBOARDING_WORK_EMAIL];
4848
const isVsb = onboardingValues && 'signupQualifier' in onboardingValues && onboardingValues.signupQualifier === CONST.ONBOARDING_SIGNUP_QUALIFIERS.VSB;
4949
// We need to use isSmallScreenWidth, see navigateAfterOnboarding function comment

src/pages/OnboardingWorkEmailValidation/BaseOnboardingWorkEmailValidation.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ import type {BaseOnboardingWorkEmailValidationProps} from './types';
2727
function BaseOnboardingWorkEmailValidation({shouldUseNativeStyles}: BaseOnboardingWorkEmailValidationProps) {
2828
const styles = useThemeStyles();
2929
const {translate} = useLocalize();
30-
const [account] = useOnyx(ONYXKEYS.ACCOUNT);
31-
const [session] = useOnyx(ONYXKEYS.SESSION);
32-
const [credentials] = useOnyx(ONYXKEYS.CREDENTIALS);
33-
const [onboardingEmail] = useOnyx(ONYXKEYS.FORMS.ONBOARDING_WORK_EMAIL_FORM);
30+
const [account] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: true});
31+
const [session] = useOnyx(ONYXKEYS.SESSION, {canBeMissing: true});
32+
const [credentials] = useOnyx(ONYXKEYS.CREDENTIALS, {canBeMissing: true});
33+
const [onboardingEmail] = useOnyx(ONYXKEYS.FORMS.ONBOARDING_WORK_EMAIL_FORM, {canBeMissing: true});
3434
const workEmail = onboardingEmail?.onboardingWorkEmail;
3535

36-
const [validateCodeAction] = useOnyx(ONYXKEYS.VALIDATE_ACTION_CODE);
36+
const [validateCodeAction] = useOnyx(ONYXKEYS.VALIDATE_ACTION_CODE, {canBeMissing: true});
3737
const {onboardingIsMediumOrLargerScreenWidth} = useResponsiveLayout();
38-
const [onboardingValues] = useOnyx(ONYXKEYS.NVP_ONBOARDING);
38+
const [onboardingValues] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {canBeMissing: true});
3939
const isVsb = onboardingValues && 'signupQualifier' in onboardingValues && onboardingValues.signupQualifier === CONST.ONBOARDING_SIGNUP_QUALIFIERS.VSB;
40-
const [onboardingErrorMessage] = useOnyx(ONYXKEYS.ONBOARDING_ERROR_MESSAGE);
40+
const [onboardingErrorMessage] = useOnyx(ONYXKEYS.ONBOARDING_ERROR_MESSAGE, {canBeMissing: true});
4141
const isValidateCodeFormSubmitting = AccountUtils.isValidateCodeFormSubmitting(account);
4242
const isFocused = useIsFocused();
4343

0 commit comments

Comments
 (0)