Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace "@react-native-community/async-storage" for "@react-native-async-storage/async-storage" #4941

Merged
merged 4 commits into from
Sep 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default from '@react-native-async-storage/async-storage/jest/async-storage-mock';
112 changes: 0 additions & 112 deletions app/__mocks__/@react-native-community/async-storage.js

This file was deleted.

2 changes: 1 addition & 1 deletion app/components/Nav/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React, {
import { NavigationContainer, CommonActions } from '@react-navigation/native';
import { Animated, Linking } from 'react-native';
import { createStackNavigator } from '@react-navigation/stack';
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import Login from '../../Views/Login';
import QRScanner from '../../Views/QRScanner';
import Onboarding from '../../Views/Onboarding';
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/WhatsNewModal/WhatsNewModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { fontStyles } from '../../../styles/common';
import Icon from 'react-native-vector-icons/FontAwesome';
import { strings } from '../../../../locales/i18n';
import Device from '../../../util/device';
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import {
CURRENT_APP_VERSION,
WHATS_NEW_APP_VERSION_SEEN,
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/ChoosePassword/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from 'react-native';
import CheckBox from '@react-native-community/checkbox';
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { connect } from 'react-redux';
import {
logIn,
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/ExtensionSync/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
NEXT_MAKER_REMINDER,
TRUE,
} from '../../../constants/storage';
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import SecureKeychain from '../../../core/SecureKeychain';
import Device from '../../../util/device';
import AppConstants from '../../../core/AppConstants';
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/ImportFromSeed/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
InteractionManager,
Platform,
} from 'react-native';
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
import { getOnboardingNavbarOptions } from '../../UI/Navbar';
import { connect } from 'react-redux';
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/Login/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
InteractionManager,
BackHandler,
} from 'react-native';
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
import Button from 'react-native-button';
import Engine from '../../../core/Engine';
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/ManualBackupStep3/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { fontStyles } from '../../../styles/common';
import Emoji from 'react-native-emoji';
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import OnboardingProgress from '../../UI/OnboardingProgress';
import ActionView from '../../UI/ActionView';
import { strings } from '../../../../locales/i18n';
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/Onboarding/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
Image,
InteractionManager,
} from 'react-native';
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import StyledButton from '../../UI/StyledButton';
import {
fontStyles,
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/ResetPassword/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from 'react-native';
import CheckBox from '@react-native-community/checkbox';
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { connect } from 'react-redux';
import {
passwordSet,
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/RevealPrivateCredential/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
Linking,
Platform,
} from 'react-native';
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import PropTypes from 'prop-types';
import QRCode from 'react-native-qrcode-svg';
import ScrollableTabView, {
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/Settings/SecuritySettings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
InteractionManager,
Linking,
} from 'react-native';
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { connect } from 'react-redux';
import { MAINNET } from '../../../../constants/network';
import ActionModal from '../../../UI/ActionModal';
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/WalletConnectSessions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { fontStyles } from '../../../styles/common';
import { strings } from '../../../../locales/i18n';
import { getNavigationOptionsTitle } from '../../UI/Navbar';
import WebsiteIcon from '../../UI/WebsiteIcon';
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import ActionSheet from 'react-native-actionsheet';
import WalletConnect from '../../../core/WalletConnect';
import Logger from '../../../util/Logger';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { renderHook } from '@testing-library/react-hooks';
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import useDeleteWallet from './useDeleteWallet';
import Engine from '../../../core/Engine';

Expand Down
2 changes: 1 addition & 1 deletion app/components/hooks/DeleteWallet/useDeleteWallet.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useCallback } from 'react';
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import Engine from '../../../core/Engine';
import Logger from '../../../util/Logger';
import { EXISTING_USER } from '../../../constants/storage';
Expand Down
2 changes: 1 addition & 1 deletion app/core/Engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
ApprovalController,
} from '@metamask/controllers';
import SwapsController, { swapsUtils } from '@metamask/swaps-controller';
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { MetaMaskKeyring as QRHardwareKeyring } from '@keystonehq/metamask-airgapped-keyring';
import Encryptor from './Encryptor';
import { toChecksumAddress } from 'ethereumjs-util';
Expand Down
2 changes: 1 addition & 1 deletion app/core/NotificationManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { hexToBN, renderFromWei } from '../util/number';
import Device from '../util/device';
import { strings } from '../../locales/i18n';
import { Alert, AppState } from 'react-native';
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import AppConstants from './AppConstants';
import {
PUSH_NOTIFICATIONS_PROMPT_COUNT,
Expand Down
2 changes: 1 addition & 1 deletion app/core/SecureKeychain.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Keychain from 'react-native-keychain'; // eslint-disable-line import/no-namespace
import Encryptor from './Encryptor';
import { strings } from '../../locales/i18n';
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { Platform } from 'react-native';
import {
BIOMETRY_CHOICE,
Expand Down
2 changes: 1 addition & 1 deletion app/core/WalletConnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Engine from './Engine';
import Logger from '../util/Logger';
// eslint-disable-next-line import/no-nodejs-modules
import { EventEmitter } from 'events';
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { CLIENT_OPTIONS, WALLET_CONNECT_ORIGIN } from '../util/walletconnect';
import { WALLETCONNECT_SESSIONS } from '../constants/storage';
import { WalletDevice } from '@metamask/controllers/';
Expand Down
2 changes: 1 addition & 1 deletion app/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
createMigrate,
createTransform,
} from 'redux-persist';
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import FilesystemStorage from 'redux-persist-filesystem-storage';
import autoMergeLevel2 from 'redux-persist/lib/stateReconciler/autoMergeLevel2';
import rootReducer from '../reducers';
Expand Down
2 changes: 1 addition & 1 deletion app/util/authentication/checkIfUsingRememberMe.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/prefer-default-export */
import SecureKeychain from '../../core/SecureKeychain';
import Engine from '../../core/Engine';
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import {
BIOMETRY_CHOICE,
PASSCODE_CHOICE,
Expand Down
2 changes: 1 addition & 1 deletion app/util/onboarding/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable import/prefer-default-export */
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import compareVersions from 'compare-versions';
import {
WHATS_NEW_APP_VERSION_SEEN,
Expand Down
7 changes: 5 additions & 2 deletions app/util/testSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Engine from '../core/Engine';

import NotificationManager from '../core/NotificationManager';
import { NativeModules } from 'react-native';
import mockAsyncStorage from '../../node_modules/@react-native-community/async-storage/jest/async-storage-mock';
import mockRNAsyncStorage from '@react-native-async-storage/async-storage/jest/async-storage-mock';
import mockClipboard from '@react-native-clipboard/clipboard/jest/clipboard-mock.js';
/* eslint-disable import/no-namespace */
import * as themeUtils from './theme';
Expand Down Expand Up @@ -118,7 +118,10 @@ jest.mock('react-native-reanimated', () =>
require('react-native-reanimated/mock'),
);
jest.mock('react-native-background-timer', () => 'RNBackgroundTimer');
jest.mock('@react-native-community/async-storage', () => mockAsyncStorage);
jest.mock(
'@react-native-async-storage/async-storage',
() => mockRNAsyncStorage,
);
jest.mock('@react-native-cookies/cookies', () => 'RNCookies');

NativeModules.RNGestureHandlerModule = {
Expand Down
8 changes: 4 additions & 4 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ PODS:
- React
- rn-fetch-blob (0.12.0):
- React-Core
- RNCAsyncStorage (1.12.1):
- RNCAsyncStorage (1.17.10):
- React-Core
- RNCCheckbox (0.5.12):
- React-Core
Expand Down Expand Up @@ -560,7 +560,7 @@ DEPENDENCIES:
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- "ReactNativePayments (from `../node_modules/@exodus/react-native-payments/lib/ios`)"
- rn-fetch-blob (from `../node_modules/rn-fetch-blob`)
- "RNCAsyncStorage (from `../node_modules/@react-native-community/async-storage`)"
- "RNCAsyncStorage (from `../node_modules/@react-native-async-storage/async-storage`)"
- "RNCCheckbox (from `../node_modules/@react-native-community/checkbox`)"
- "RNCClipboard (from `../node_modules/@react-native-clipboard/clipboard`)"
- "RNCMaskedView (from `../node_modules/@react-native-masked-view/masked-view`)"
Expand Down Expand Up @@ -706,7 +706,7 @@ EXTERNAL SOURCES:
rn-fetch-blob:
:path: "../node_modules/rn-fetch-blob"
RNCAsyncStorage:
:path: "../node_modules/@react-native-community/async-storage"
:path: "../node_modules/@react-native-async-storage/async-storage"
RNCCheckbox:
:path: "../node_modules/@react-native-community/checkbox"
RNCClipboard:
Expand Down Expand Up @@ -815,7 +815,7 @@ SPEC CHECKSUMS:
ReactCommon: 9bac022ab71596f2b0fde1268272543184c63971
ReactNativePayments: a4e3ac915256a4e759c8a04338b558494a63a0f5
rn-fetch-blob: f065bb7ab7fb48dd002629f8bdcb0336602d3cba
RNCAsyncStorage: b03032fdbdb725bea0bd9e5ec5a7272865ae7398
RNCAsyncStorage: 0c357f3156fcb16c8589ede67cc036330b6698ca
RNCCheckbox: ed1b4ca295475b41e7251ebae046360a703b6eb5
RNCClipboard: ddd4d291537f1667209c9c405aaa4307297e252e
RNCMaskedView: c298b644a10c0c142055b3ae24d83879ecb13ccd
Expand Down
2 changes: 1 addition & 1 deletion locales/i18n.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ReactNative from 'react-native';
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import I18n from 'react-native-i18n';
// eslint-disable-next-line import/no-nodejs-modules
import { EventEmitter } from 'events';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@
"@metamask/etherscan-link": "^2.0.0",
"@metamask/swaps-controller": "^6.6.0",
"@ngraveio/bc-ur": "^1.1.6",
"@react-native-async-storage/async-storage": "1.17.10",
"@react-native-clipboard/clipboard": "^1.8.4",
"@react-native-community/async-storage": "1.12.1",
"@react-native-community/blur": "^3.6.0",
"@react-native-community/checkbox": "^0.5.12",
"@react-native-community/netinfo": "6.0.0",
Expand Down
Loading