Skip to content

Commit

Permalink
Fix lint check errors
Browse files Browse the repository at this point in the history
  • Loading branch information
VickyStash committed Sep 23, 2024
1 parent ba756a5 commit 4713c7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/libs/ValidationUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import StringUtils from './StringUtils';
function validateCardNumber(value: string): boolean {
let sum = 0;
for (let i = 0; i < value.length; i++) {
let intVal = parseInt(value.substr(i, 1), 10);
let intVal = parseInt(value.charAt(i), 10);
if (i % 2 === 0) {
intVal *= 2;
if (intVal > 9) {
Expand Down
20 changes: 5 additions & 15 deletions src/pages/settings/Profile/DisplayNamePage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import {View} from 'react-native';
import type {OnyxEntry} from 'react-native-onyx';
import {withOnyx} from 'react-native-onyx';
import {useOnyx} from 'react-native-onyx';
import FormProvider from '@components/Form/FormProvider';
import InputWrapper from '@components/Form/InputWrapper';
import type {FormInputErrors, FormOnyxValues} from '@components/Form/types';
Expand All @@ -22,11 +21,7 @@ import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import INPUT_IDS from '@src/types/form/DisplayNameForm';

type DisplayNamePageOnyxProps = {
isLoadingApp: OnyxEntry<boolean>;
};

type DisplayNamePageProps = DisplayNamePageOnyxProps & WithCurrentUserPersonalDetailsProps;
type DisplayNamePageProps = WithCurrentUserPersonalDetailsProps;

/**
* Submit form to update user's first and last name (and display name)
Expand All @@ -36,9 +31,10 @@ const updateDisplayName = (values: FormOnyxValues<typeof ONYXKEYS.FORMS.DISPLAY_
Navigation.goBack();
};

function DisplayNamePage({isLoadingApp = true, currentUserPersonalDetails}: DisplayNamePageProps) {
function DisplayNamePage({currentUserPersonalDetails}: DisplayNamePageProps) {
const styles = useThemeStyles();
const {translate} = useLocalize();
const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP, {initialValue: true});

const currentUserDetails = currentUserPersonalDetails ?? {};

Expand Down Expand Up @@ -126,10 +122,4 @@ function DisplayNamePage({isLoadingApp = true, currentUserPersonalDetails}: Disp

DisplayNamePage.displayName = 'DisplayNamePage';

export default withCurrentUserPersonalDetails(
withOnyx<DisplayNamePageProps, DisplayNamePageOnyxProps>({
isLoadingApp: {
key: ONYXKEYS.IS_LOADING_APP,
},
})(DisplayNamePage),
);
export default withCurrentUserPersonalDetails(DisplayNamePage);

0 comments on commit 4713c7e

Please sign in to comment.