Skip to content

Commit

Permalink
Merge pull request #3100 from near/master
Browse files Browse the repository at this point in the history
2023-08-18 Release
  • Loading branch information
andy-haynes authored Aug 18, 2023
2 parents 0f0a4ab + 2c3bc77 commit f2bb940
Showing 1 changed file with 4 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,19 @@ import './WalletSelectorModalContext.css';
import { useDispatch } from 'react-redux';

import { showCustomAlert } from '../../../../redux/actions/status';
import { shuffle } from '../../../../utils/staking';

const ExportAccountSelectorContext =
React.createContext(null);


// If target wallet is production ready, add it to this list
const MAINNET_MODULES = [
setupNightly,
setupMeteorWallet,
setupWelldoneWallet,
setupHereWallet,
setupMyNearWallet,
setupSender,
];

const TESTNET_MODULES = [
const WALLET_MODULES = [
setupMyNearWallet,
setupMeteorWallet,
setupSender,
setupHereWallet,
setupNightly,
setupWelldoneWallet,
setupHereWallet,
setupSender,
];

const initializeModules = (network) => {
const modules = network === 'testnet' ? TESTNET_MODULES : MAINNET_MODULES;
return shuffle(modules).map((module) => module());
};

export const ExportAccountSelectorContextProvider = ({ children, network, migrationAccounts, onComplete }) => {
const [importSelector, setSelector] = useState(null);
const [ExportModal, setModal] = useState(null);
Expand All @@ -53,7 +36,7 @@ export const ExportAccountSelectorContextProvider = ({ children, network, migrat
const selector = await setupWalletSelector({
allowMultipleSelectors: true,
network,
modules: initializeModules(network),
modules: WALLET_MODULES.map((module) => module()),
});
const modal = setupExportSelectorModal(selector, {
accounts: migrationAccounts,
Expand Down

0 comments on commit f2bb940

Please sign in to comment.