From bb715a1cb4a9306d18cdc4056d01d66dad09b9f4 Mon Sep 17 00:00:00 2001 From: marcinbodnardesktop Date: Wed, 12 May 2021 21:53:57 +0200 Subject: [PATCH 01/17] Add redux-persist dependency (#1666) --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index a56c706e10..e82129e8a3 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "reduce-reducers": "^1.0.4", "redux": "^4.0.5", "redux-actions": "^2.6.5", + "redux-persist": "^6.0.0", "redux-thunk": "^2.3.0", "regenerator-runtime": "^0.13.5", "semantic-ui-css": "^2.4.1", From 4581c4023185efa46734d1f426753ec5db16085e Mon Sep 17 00:00:00 2001 From: marcinbodnardesktop Date: Wed, 12 May 2021 21:54:28 +0200 Subject: [PATCH 02/17] redux-persist configuration (#1666) --- src/index.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index e54f62847f..39af8dc88f 100644 --- a/src/index.js +++ b/src/index.js @@ -6,6 +6,11 @@ import ReactDOM from 'react-dom' import { initSentry } from './utils/sentry' import { createStore } from 'redux' + +import { persistStore, persistReducer } from 'redux-persist' +import storage from 'redux-persist/lib/storage' +import { PersistGate } from 'redux-persist/integration/react' + import { Provider } from 'react-redux' import { LocalizeProvider } from 'react-localize-redux'; import { createBrowserHistory } from 'history' @@ -17,9 +22,17 @@ import Routing from './components/Routing' initSentry(); +const persistConfig = { + key: 'root', + storage, +} + const history = createBrowserHistory() -export const store = createStore(createRootReducer(history), createMiddleware(history)) +const persistedReducer = persistReducer(persistConfig, createRootReducer(history)) + +export const store = createStore(persistedReducer, createMiddleware(history)) +let persistor = persistStore(store) ReactDOM.render( From cc56f8cd8de23d39d61e8e2fdc0e3b937a27ce66 Mon Sep 17 00:00:00 2001 From: marcinbodnardesktop Date: Wed, 12 May 2021 21:54:46 +0200 Subject: [PATCH 03/17] Use redux-persist (#1666) --- src/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 39af8dc88f..532cba5554 100644 --- a/src/index.js +++ b/src/index.js @@ -36,9 +36,11 @@ let persistor = persistStore(store) ReactDOM.render( - - - + + + + + , document.getElementById('root') ) From c394cba0212b68c177ab567bf4cad819ae60087d Mon Sep 17 00:00:00 2001 From: marcinbodnardesktop Date: Wed, 12 May 2021 22:01:24 +0200 Subject: [PATCH 04/17] Add store.js file to handle store configuration (#1666) --- src/redux/store.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/redux/store.js diff --git a/src/redux/store.js b/src/redux/store.js new file mode 100644 index 0000000000..2a9fa54cdf --- /dev/null +++ b/src/redux/store.js @@ -0,0 +1,20 @@ +import { createStore } from 'redux' +import { persistStore, persistReducer } from 'redux-persist' +import storage from 'redux-persist/lib/storage' +import { createBrowserHistory } from 'history' + +import createRootReducer from '../reducers' +import createMiddleware from '../middleware' + +const persistConfig = { + key: 'root', + storage, +} + +export const history = createBrowserHistory() + +const persistedReducer = persistReducer(persistConfig, createRootReducer(history)) + +export const store = createStore(persistedReducer, createMiddleware(history)) + +export let persistor = persistStore(store) From b0aad608752debc28179a7b7749cbb66c1945aec Mon Sep 17 00:00:00 2001 From: marcinbodnardesktop Date: Wed, 12 May 2021 22:01:57 +0200 Subject: [PATCH 05/17] Refactor index.js to use store configuration file (#1666) --- src/index.js | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/src/index.js b/src/index.js index 532cba5554..df09610e5e 100644 --- a/src/index.js +++ b/src/index.js @@ -4,36 +4,15 @@ import React from 'react' import ReactDOM from 'react-dom' import { initSentry } from './utils/sentry' - -import { createStore } from 'redux' - -import { persistStore, persistReducer } from 'redux-persist' -import storage from 'redux-persist/lib/storage' -import { PersistGate } from 'redux-persist/integration/react' - import { Provider } from 'react-redux' import { LocalizeProvider } from 'react-localize-redux'; -import { createBrowserHistory } from 'history' - -import createRootReducer from './reducers' -import createMiddleware from './middleware' +import { PersistGate } from 'redux-persist/integration/react' import Routing from './components/Routing' +import { store, persistor, history } from './redux/store' initSentry(); -const persistConfig = { - key: 'root', - storage, -} - -const history = createBrowserHistory() - -const persistedReducer = persistReducer(persistConfig, createRootReducer(history)) - -export const store = createStore(persistedReducer, createMiddleware(history)) -let persistor = persistStore(store) - ReactDOM.render( From 23257537a7bba2ad7e4edbb612eecab3f803b108 Mon Sep 17 00:00:00 2001 From: marcinbodnardesktop Date: Wed, 12 May 2021 22:02:22 +0200 Subject: [PATCH 06/17] Update imports (#1666) --- src/utils/alerts.js | 2 +- src/utils/twoFactor.js | 2 +- src/utils/wallet.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/alerts.js b/src/utils/alerts.js index 1a88b1defd..8bfda5bd66 100644 --- a/src/utils/alerts.js +++ b/src/utils/alerts.js @@ -1,4 +1,4 @@ -import { store } from '..' +import { store } from '../redux/store' import { clearGlobalAlert, clearLocalAlert } from '../actions/status' export const showAlert = ({data, onlyError, onlySuccess, console = true, localAlert, messageCodeHeader, success} = {}) => ({ diff --git a/src/utils/twoFactor.js b/src/utils/twoFactor.js index 77204fe27d..3d6a95813b 100644 --- a/src/utils/twoFactor.js +++ b/src/utils/twoFactor.js @@ -1,5 +1,5 @@ import * as nearApiJs from 'near-api-js' -import { store } from '..' +import { store } from '../redux/store' import { promptTwoFactor, refreshAccount } from '../actions/account' import { MULTISIG_MIN_AMOUNT, ACCOUNT_HELPER_URL } from './wallet' import { utils } from 'near-api-js' diff --git a/src/utils/wallet.js b/src/utils/wallet.js index aa34df96e8..81e56973ab 100644 --- a/src/utils/wallet.js +++ b/src/utils/wallet.js @@ -10,7 +10,7 @@ import { generateSeedPhrase } from 'near-seed-phrase'; import { WalletError } from './walletError' import { setAccountConfirmed, getAccountConfirmed } from './localStorage' -import { store } from '..' +import { store } from '../redux/store' import { setSignTransactionStatus, setLedgerTxSigned, From dc5b9d4a2813f24a05fed9c4c79135d9ca226755 Mon Sep 17 00:00:00 2001 From: marcinbodnardesktop Date: Wed, 12 May 2021 22:11:24 +0200 Subject: [PATCH 07/17] Simplify index.js (#1666) --- src/index.js | 16 ++++------------ src/redux/store.js | 19 +++++++++++++++++-- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/index.js b/src/index.js index df09610e5e..428dd73d97 100644 --- a/src/index.js +++ b/src/index.js @@ -4,22 +4,14 @@ import React from 'react' import ReactDOM from 'react-dom' import { initSentry } from './utils/sentry' -import { Provider } from 'react-redux' -import { LocalizeProvider } from 'react-localize-redux'; -import { PersistGate } from 'redux-persist/integration/react' - import Routing from './components/Routing' -import { store, persistor, history } from './redux/store' +import StoreConfiguration from './redux/store' initSentry(); ReactDOM.render( - - - - - - - , + + + , document.getElementById('root') ) diff --git a/src/redux/store.js b/src/redux/store.js index 2a9fa54cdf..3f148f6e02 100644 --- a/src/redux/store.js +++ b/src/redux/store.js @@ -1,8 +1,13 @@ +import React from 'react' import { createStore } from 'redux' import { persistStore, persistReducer } from 'redux-persist' import storage from 'redux-persist/lib/storage' import { createBrowserHistory } from 'history' +import { Provider } from 'react-redux' +import { LocalizeProvider } from 'react-localize-redux'; +import { PersistGate } from 'redux-persist/integration/react' + import createRootReducer from '../reducers' import createMiddleware from '../middleware' @@ -11,10 +16,20 @@ const persistConfig = { storage, } -export const history = createBrowserHistory() +const history = createBrowserHistory() const persistedReducer = persistReducer(persistConfig, createRootReducer(history)) export const store = createStore(persistedReducer, createMiddleware(history)) -export let persistor = persistStore(store) +let persistor = persistStore(store) + +export default ({ children }) => ( + + + + {children} + + + +) From ef54d0501a4f5ecb650943a754b07081a82e4e05 Mon Sep 17 00:00:00 2001 From: marcinbodnardesktop Date: Wed, 12 May 2021 22:13:48 +0200 Subject: [PATCH 08/17] Fix history (#1666) --- src/index.js | 1 + src/redux/store.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 428dd73d97..8a0d3711d6 100644 --- a/src/index.js +++ b/src/index.js @@ -6,6 +6,7 @@ import ReactDOM from 'react-dom' import { initSentry } from './utils/sentry' import Routing from './components/Routing' import StoreConfiguration from './redux/store' +import { history } from './redux/store' initSentry(); diff --git a/src/redux/store.js b/src/redux/store.js index 3f148f6e02..bf930609f0 100644 --- a/src/redux/store.js +++ b/src/redux/store.js @@ -16,7 +16,7 @@ const persistConfig = { storage, } -const history = createBrowserHistory() +export const history = createBrowserHistory() const persistedReducer = persistReducer(persistConfig, createRootReducer(history)) From 5965f7f85ab894db02eb50b7494ea18f4a7c462a Mon Sep 17 00:00:00 2001 From: marcinbodnardesktop Date: Mon, 17 May 2021 23:37:38 +0200 Subject: [PATCH 09/17] Refactor getAccountBalance to return strings (#1666) --- src/utils/account-with-lockup.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/utils/account-with-lockup.js b/src/utils/account-with-lockup.js index 93ac0374c0..dd29847f85 100644 --- a/src/utils/account-with-lockup.js +++ b/src/utils/account-with-lockup.js @@ -197,15 +197,15 @@ async function getAccountBalance(limitedAccountData = false) { return { ...balance, balanceAvailable: balance.available, - available, - ownersBalance, - liquidOwnersBalance, - lockedAmount, - total: new BN(balance.total).add(new BN(lockedAmount)).add(new BN(ownersBalance)).add(stakedBalanceMainAccount).toString(), - totalBalance, - stakedBalanceLockup: stakedBalanceLockup, + available: available.toString(), + ownersBalance: ownersBalance.toString(), + liquidOwnersBalance: liquidOwnersBalance.toString(), + lockedAmount: lockedAmount.toString(), + total: new BN(balance.total).add(lockedAmount).add(ownersBalance).add(stakedBalanceMainAccount).toString(), + totalBalance: totalBalance.toString(), + stakedBalanceLockup: stakedBalanceLockup.toString(), lockupAccountId, - stakedBalanceMainAccount + stakedBalanceMainAccount: stakedBalanceMainAccount.toString() } } catch (error) { if (error.message.match(/ccount ".+" doesn't exist/) || error.message.includes('does not exist while viewing') || error.message.includes('cannot find contract code for account')) { @@ -213,7 +213,7 @@ async function getAccountBalance(limitedAccountData = false) { ...balance, balanceAvailable: balance.available, total: new BN(balance.total).add(stakedBalanceMainAccount).toString(), - stakedBalanceMainAccount, + stakedBalanceMainAccount: stakedBalanceMainAccount.toString(), } } From b0f1bade064f917bc63701a86ac2badd69546fc3 Mon Sep 17 00:00:00 2001 From: marcinbodnardesktop Date: Mon, 17 May 2021 23:38:09 +0200 Subject: [PATCH 10/17] Add blacklist to redux persist config (#1666) --- src/redux/store.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/redux/store.js b/src/redux/store.js index bf930609f0..db7b734f85 100644 --- a/src/redux/store.js +++ b/src/redux/store.js @@ -14,6 +14,7 @@ import createMiddleware from '../middleware' const persistConfig = { key: 'root', storage, + blacklist: ['status', 'staking'] } export const history = createBrowserHistory() From bd63a4b780a40d77f8136e05a6c1d1fd870b8136 Mon Sep 17 00:00:00 2001 From: marcinbodnardesktop Date: Mon, 17 May 2021 23:38:51 +0200 Subject: [PATCH 11/17] Refactor balance selector to handle strings (#1666) --- src/reducers/selectors/balance.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/reducers/selectors/balance.js b/src/reducers/selectors/balance.js index 043f80c20f..02f27f8ff0 100644 --- a/src/reducers/selectors/balance.js +++ b/src/reducers/selectors/balance.js @@ -23,10 +23,10 @@ export const selectProfileBalance = (balance) => { const lockupIdExists = !!lockedAmount const walletBalance = { - walletBalance: stakedBalanceMainAccount.add(new BN(balanceAvailable)).add(new BN(stateStaked)).toString(), - reservedForStorage: stateStaked.toString(), + walletBalance: new BN(stakedBalanceMainAccount).add(new BN(balanceAvailable)).add(new BN(stateStaked)).toString(), + reservedForStorage: stateStaked, inStakingPools: { - sum: stakedBalanceMainAccount.toString(), + sum: stakedBalanceMainAccount, staked: account?.totalStaked, pendingRelease: account?.totalPending, availableForWithdraw: account?.totalAvailable @@ -41,18 +41,18 @@ export const selectProfileBalance = (balance) => { } = balance lockupBalance = { - lockupBalance: totalBalance.toString(), + lockupBalance: totalBalance, reservedForStorage: LOCKUP_MIN_BALANCE.toString(), inStakingPools: { - sum: stakedBalanceLockup.toString(), + sum: stakedBalanceLockup, staked: lockupAccount?.totalStaked, pendingRelease: lockupAccount?.totalPending && new BN(lockupAccount.totalPending).toString(), availableForWithdraw: lockupAccount?.totalAvailable && new BN(lockupAccount.totalAvailable).toString() }, - locked: lockedAmount.toString(), + locked: lockedAmount, unlocked: { - sum: ownersBalance.toString(), - availableToTransfer: liquidOwnersBalance.toString() + sum: ownersBalance, + availableToTransfer: liquidOwnersBalance } } } From 7ff775b12427e979ad4ccb561895e12b15d07a87 Mon Sep 17 00:00:00 2001 From: marcinbodnardesktop Date: Mon, 17 May 2021 23:44:51 +0200 Subject: [PATCH 12/17] Block sending money until balance is fetched (#1666) --- src/components/send/SendContainer.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/send/SendContainer.js b/src/components/send/SendContainer.js index 55ae8915ae..af859c4dfa 100644 --- a/src/components/send/SendContainer.js +++ b/src/components/send/SendContainer.js @@ -19,6 +19,7 @@ import TransferMoneyIcon from '../svg/TransferMoneyIcon' import { onKeyDown } from '../../hooks/eventListeners' import classNames from '../../utils/classNames' import { Mixpanel } from '../../mixpanel/index' +import { actionsPending } from '../../utils/alerts' const { parseNearAmount, formatNearAmount @@ -57,7 +58,13 @@ export function SendContainer({ match, location }) { const sufficientBalance = balance?.available ? !new BN(parseNearAmount(amount)).isZero() && (new BN(parseNearAmount(amount)).lte(amountAvailableToSend) || useMax) && isDecimalString(amount) : undefined - const sendAllowed = ((localAlert && localAlert.success !== false) || id.length === 64) && sufficientBalance && amount && !mainLoader && !success + + const sendAllowed = ((localAlert && localAlert.success !== false) || id.length === 64) + && sufficientBalance + && amount + && !mainLoader + && !success + && !actionsPending('GET_BALANCE') useEffect(() => { if (success) { From 865faa7c7d5a63646ab032d23042753da0c7e33e Mon Sep 17 00:00:00 2001 From: marcinbodnardesktop Date: Mon, 17 May 2021 23:48:56 +0200 Subject: [PATCH 13/17] Aet redux persist key to accountId (#1666) --- src/redux/store.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/redux/store.js b/src/redux/store.js index db7b734f85..c24c6a733e 100644 --- a/src/redux/store.js +++ b/src/redux/store.js @@ -11,8 +11,10 @@ import { PersistGate } from 'redux-persist/integration/react' import createRootReducer from '../reducers' import createMiddleware from '../middleware' +import { wallet } from '../utils/wallet' + const persistConfig = { - key: 'root', + key: wallet.accountId, storage, blacklist: ['status', 'staking'] } From 03361f12338fd3f685e97f8bdaedb96375cb19d9 Mon Sep 17 00:00:00 2001 From: marcinbodnardesktop Date: Wed, 19 May 2021 00:37:59 +0200 Subject: [PATCH 14/17] Fix lock file (#1666) --- yarn.lock | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/yarn.lock b/yarn.lock index 290f6541d0..70751868fe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11907,6 +11907,11 @@ redux-actions@^2.6.5: reduce-reducers "^0.4.3" to-camel-case "^1.0.0" +redux-persist@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/redux-persist/-/redux-persist-6.0.0.tgz#b4d2972f9859597c130d40d4b146fecdab51b3a8" + integrity sha512-71LLMbUq2r02ng2We9S215LtPu3fY0KgaGE0k8WRgl6RkqxtGfl7HUozz1Dftwsb0D/5mZ8dwAaPbtnzfvbEwQ== + redux-thunk@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.3.0.tgz#51c2c19a185ed5187aaa9a2d08b666d0d6467622" From 52a672e6e469cfcb8ff1ebeb98a3cd17d7dce6fd Mon Sep 17 00:00:00 2001 From: marcinbodnardesktop Date: Wed, 19 May 2021 00:47:22 +0200 Subject: [PATCH 15/17] Change redux persist config (#1666) --- src/redux/store.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/redux/store.js b/src/redux/store.js index c24c6a733e..0e8d10261e 100644 --- a/src/redux/store.js +++ b/src/redux/store.js @@ -11,10 +11,10 @@ import { PersistGate } from 'redux-persist/integration/react' import createRootReducer from '../reducers' import createMiddleware from '../middleware' -import { wallet } from '../utils/wallet' +import { ACCOUNT_ID_SUFFIX } from '../utils/wallet' const persistConfig = { - key: wallet.accountId, + key: `wallet.near.org:${ACCOUNT_ID_SUFFIX}`, storage, blacklist: ['status', 'staking'] } From bffb63c1bad905edc565d1da8da6f65a8aaf08fe Mon Sep 17 00:00:00 2001 From: marcinbodnardesktop Date: Wed, 2 Jun 2021 00:14:06 +0200 Subject: [PATCH 16/17] Stop persisting after QuotaExceededError error (#1666) --- src/redux/store.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/redux/store.js b/src/redux/store.js index 0e8d10261e..cfbe1a6041 100644 --- a/src/redux/store.js +++ b/src/redux/store.js @@ -16,7 +16,12 @@ import { ACCOUNT_ID_SUFFIX } from '../utils/wallet' const persistConfig = { key: `wallet.near.org:${ACCOUNT_ID_SUFFIX}`, storage, - blacklist: ['status', 'staking'] + blacklist: ['status', 'staking'], + writeFailHandler: (error) => { + if (error.name === 'QuotaExceededError') { + persistor.pause() + } + } } export const history = createBrowserHistory() From db9d28e163f93a5cb743b12ca02fe2f99422cc28 Mon Sep 17 00:00:00 2001 From: marcinbodnardesktop Date: Thu, 3 Jun 2021 21:21:00 +0200 Subject: [PATCH 17/17] Remove store.js configuration file (#1666) --- src/index.js | 44 +++++++++++++++++++++++++++++++++++++----- src/redux/store.js | 43 ----------------------------------------- src/utils/alerts.js | 2 +- src/utils/twoFactor.js | 2 +- src/utils/wallet.js | 2 +- 5 files changed, 42 insertions(+), 51 deletions(-) delete mode 100644 src/redux/store.js diff --git a/src/index.js b/src/index.js index 8a0d3711d6..6c42f5d281 100644 --- a/src/index.js +++ b/src/index.js @@ -3,16 +3,50 @@ import "regenerator-runtime/runtime"; import React from 'react' import ReactDOM from 'react-dom' +import { createStore } from 'redux' +import storage from 'redux-persist/lib/storage' +import { createBrowserHistory } from 'history' +import { Provider } from 'react-redux' +import { LocalizeProvider } from 'react-localize-redux'; + +import { persistStore, persistReducer } from 'redux-persist' +import { PersistGate } from 'redux-persist/integration/react' + +import createRootReducer from './reducers' +import createMiddleware from './middleware' import { initSentry } from './utils/sentry' import Routing from './components/Routing' -import StoreConfiguration from './redux/store' -import { history } from './redux/store' + +import { ACCOUNT_ID_SUFFIX } from './utils/wallet' initSentry(); +const persistConfig = { + key: `wallet.near.org:${ACCOUNT_ID_SUFFIX}`, + storage, + blacklist: ['status', 'staking'], + writeFailHandler: (error) => { + if (error.name === 'QuotaExceededError') { + persistor.pause() + } + } +} + +export const history = createBrowserHistory() + +const persistedReducer = persistReducer(persistConfig, createRootReducer(history)) + +export const store = createStore(persistedReducer, createMiddleware(history)) + +let persistor = persistStore(store) + ReactDOM.render( - - - , + + + + + + + , document.getElementById('root') ) diff --git a/src/redux/store.js b/src/redux/store.js deleted file mode 100644 index cfbe1a6041..0000000000 --- a/src/redux/store.js +++ /dev/null @@ -1,43 +0,0 @@ -import React from 'react' -import { createStore } from 'redux' -import { persistStore, persistReducer } from 'redux-persist' -import storage from 'redux-persist/lib/storage' -import { createBrowserHistory } from 'history' - -import { Provider } from 'react-redux' -import { LocalizeProvider } from 'react-localize-redux'; -import { PersistGate } from 'redux-persist/integration/react' - -import createRootReducer from '../reducers' -import createMiddleware from '../middleware' - -import { ACCOUNT_ID_SUFFIX } from '../utils/wallet' - -const persistConfig = { - key: `wallet.near.org:${ACCOUNT_ID_SUFFIX}`, - storage, - blacklist: ['status', 'staking'], - writeFailHandler: (error) => { - if (error.name === 'QuotaExceededError') { - persistor.pause() - } - } -} - -export const history = createBrowserHistory() - -const persistedReducer = persistReducer(persistConfig, createRootReducer(history)) - -export const store = createStore(persistedReducer, createMiddleware(history)) - -let persistor = persistStore(store) - -export default ({ children }) => ( - - - - {children} - - - -) diff --git a/src/utils/alerts.js b/src/utils/alerts.js index 8bfda5bd66..1a88b1defd 100644 --- a/src/utils/alerts.js +++ b/src/utils/alerts.js @@ -1,4 +1,4 @@ -import { store } from '../redux/store' +import { store } from '..' import { clearGlobalAlert, clearLocalAlert } from '../actions/status' export const showAlert = ({data, onlyError, onlySuccess, console = true, localAlert, messageCodeHeader, success} = {}) => ({ diff --git a/src/utils/twoFactor.js b/src/utils/twoFactor.js index 3d6a95813b..77204fe27d 100644 --- a/src/utils/twoFactor.js +++ b/src/utils/twoFactor.js @@ -1,5 +1,5 @@ import * as nearApiJs from 'near-api-js' -import { store } from '../redux/store' +import { store } from '..' import { promptTwoFactor, refreshAccount } from '../actions/account' import { MULTISIG_MIN_AMOUNT, ACCOUNT_HELPER_URL } from './wallet' import { utils } from 'near-api-js' diff --git a/src/utils/wallet.js b/src/utils/wallet.js index 81e56973ab..aa34df96e8 100644 --- a/src/utils/wallet.js +++ b/src/utils/wallet.js @@ -10,7 +10,7 @@ import { generateSeedPhrase } from 'near-seed-phrase'; import { WalletError } from './walletError' import { setAccountConfirmed, getAccountConfirmed } from './localStorage' -import { store } from '../redux/store' +import { store } from '..' import { setSignTransactionStatus, setLedgerTxSigned,