Skip to content

Commit cd96b5d

Browse files
fix: resolve eslint errors
1 parent fa197ff commit cd96b5d

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

src/components/AnonymousReportFooter.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type {OnyxEntry} from 'react-native-onyx';
44
import useLocalize from '@hooks/useLocalize';
55
import usePolicy from '@hooks/usePolicy';
66
import useThemeStyles from '@hooks/useThemeStyles';
7-
import * as Session from '@userActions/Session';
7+
import {signOutAndRedirectToSignIn} from '@userActions/Session';
88
import type {Report} from '@src/types/onyx';
99
import AvatarWithDisplayName from './AvatarWithDisplayName';
1010
import Button from './Button';
@@ -46,7 +46,7 @@ function AnonymousReportFooter({isSmallSizeLayout = false, report}: AnonymousRep
4646
<Button
4747
success
4848
text={translate('common.signIn')}
49-
onPress={() => Session.signOutAndRedirectToSignIn()}
49+
onPress={() => signOutAndRedirectToSignIn()}
5050
/>
5151
</View>
5252
</View>

src/components/CardPreview.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import Text from './Text';
1111
function CardPreview() {
1212
const styles = useThemeStyles();
1313

14-
const [privatePersonalDetails] = useOnyx(ONYXKEYS.PRIVATE_PERSONAL_DETAILS);
15-
const [session] = useOnyx(ONYXKEYS.SESSION);
14+
const [privatePersonalDetails] = useOnyx(ONYXKEYS.PRIVATE_PERSONAL_DETAILS, {canBeMissing: true});
15+
const [session] = useOnyx(ONYXKEYS.SESSION, {canBeMissing: true});
1616

1717
const {legalFirstName, legalLastName} = privatePersonalDetails ?? {};
1818
const cardHolder = legalFirstName && legalLastName ? `${legalFirstName} ${legalLastName}` : (session?.email ?? '');

src/components/ConfirmedRoute.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import useOnyx from '@hooks/useOnyx';
66
import useStyleUtils from '@hooks/useStyleUtils';
77
import useTheme from '@hooks/useTheme';
88
import useThemeStyles from '@hooks/useThemeStyles';
9-
import * as TransactionUtils from '@libs/TransactionUtils';
10-
import * as MapboxToken from '@userActions/MapboxToken';
9+
import {getWaypointIndex} from '@libs/TransactionUtils';
10+
import {init as initMapboxToken, stop as stopMapboxToken} from '@userActions/MapboxToken';
1111
import CONST from '@src/CONST';
1212
import ONYXKEYS from '@src/ONYXKEYS';
1313
import type {Transaction} from '@src/types/onyx';
@@ -46,7 +46,7 @@ function ConfirmedRoute({transaction, isSmallerIcon, shouldHaveBorderRadius = tr
4646
const styles = useThemeStyles();
4747
const StyleUtils = useStyleUtils();
4848

49-
const [mapboxAccessToken] = useOnyx(ONYXKEYS.MAPBOX_ACCESS_TOKEN);
49+
const [mapboxAccessToken] = useOnyx(ONYXKEYS.MAPBOX_ACCESS_TOKEN, {canBeMissing: true});
5050

5151
const getMarkerComponent = useCallback(
5252
(icon: IconAsset): ReactNode => (
@@ -71,7 +71,7 @@ function ConfirmedRoute({transaction, isSmallerIcon, shouldHaveBorderRadius = tr
7171
return;
7272
}
7373

74-
const index = TransactionUtils.getWaypointIndex(key);
74+
const index = getWaypointIndex(key);
7575
let MarkerComponent: IconAsset;
7676
if (index === 0) {
7777
MarkerComponent = Expensicons.DotIndicatorUnfilled;
@@ -95,8 +95,8 @@ function ConfirmedRoute({transaction, isSmallerIcon, shouldHaveBorderRadius = tr
9595
const waypointMarkers = getWaypointMarkers(waypoints);
9696

9797
useEffect(() => {
98-
MapboxToken.init();
99-
return MapboxToken.stop;
98+
initMapboxToken();
99+
return stopMapboxToken;
100100
}, []);
101101

102102
const shouldDisplayMap = !requireRouteToDisplayMap || !!coordinates.length;

src/components/PDFView/index.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import useStyleUtils from '@hooks/useStyleUtils';
1414
import useThemeStyles from '@hooks/useThemeStyles';
1515
import useWindowDimensions from '@hooks/useWindowDimensions';
1616
import variables from '@styles/variables';
17-
import * as CanvasSize from '@userActions/CanvasSize';
17+
import {retrieveMaxCanvasArea, retrieveMaxCanvasHeight, retrieveMaxCanvasWidth} from '@userActions/CanvasSize';
1818
import CONST from '@src/CONST';
1919
import ONYXKEYS from '@src/ONYXKEYS';
2020
import PDFPasswordForm from './PDFPasswordForm';
@@ -32,9 +32,9 @@ function PDFView({onToggleKeyboard, fileName, onPress, isFocused, sourceURL, sty
3232
const prevWindowHeight = usePrevious(windowHeight);
3333
const {translate} = useLocalize();
3434

35-
const [maxCanvasArea] = useOnyx(ONYXKEYS.MAX_CANVAS_AREA);
36-
const [maxCanvasHeight] = useOnyx(ONYXKEYS.MAX_CANVAS_HEIGHT);
37-
const [maxCanvasWidth] = useOnyx(ONYXKEYS.MAX_CANVAS_WIDTH);
35+
const [maxCanvasArea] = useOnyx(ONYXKEYS.MAX_CANVAS_AREA, {canBeMissing: true});
36+
const [maxCanvasHeight] = useOnyx(ONYXKEYS.MAX_CANVAS_HEIGHT, {canBeMissing: true});
37+
const [maxCanvasWidth] = useOnyx(ONYXKEYS.MAX_CANVAS_WIDTH, {canBeMissing: true});
3838

3939
/**
4040
* On small screens notify parent that the keyboard has opened or closed.
@@ -57,15 +57,15 @@ function PDFView({onToggleKeyboard, fileName, onPress, isFocused, sourceURL, sty
5757
*/
5858
const retrieveCanvasLimits = () => {
5959
if (!maxCanvasArea) {
60-
CanvasSize.retrieveMaxCanvasArea();
60+
retrieveMaxCanvasArea();
6161
}
6262

6363
if (!maxCanvasHeight) {
64-
CanvasSize.retrieveMaxCanvasHeight();
64+
retrieveMaxCanvasHeight();
6565
}
6666

6767
if (!maxCanvasWidth) {
68-
CanvasSize.retrieveMaxCanvasWidth();
68+
retrieveMaxCanvasWidth();
6969
}
7070
};
7171

0 commit comments

Comments
 (0)