diff --git a/src/logic/tokens/store/actions/addToken.js b/src/logic/tokens/store/actions/addToken.js index 71c927c9..6d3fe9e4 100644 --- a/src/logic/tokens/store/actions/addToken.js +++ b/src/logic/tokens/store/actions/addToken.js @@ -1,7 +1,7 @@ // @flow import { createAction } from 'redux-actions' import { type Token } from '~/logic/tokens/store/model/token' -import { setActiveTokens, getActiveTokens, setToken } from '~/logic/tokens/utils/tokensStorage' +import { saveActiveTokens, getActiveTokens, setToken } from '~/logic/tokens/utils/tokensStorage' import type { Dispatch as ReduxDispatch } from 'redux' import { type GlobalState } from '~/store/' @@ -23,7 +23,7 @@ const saveToken = (safeAddress: string, token: Token) => async (dispatch: ReduxD dispatch(addToken(token)) const activeTokens = await getActiveTokens(safeAddress) - await setActiveTokens(safeAddress, activeTokens.push(token.toJS())) + await saveActiveTokens(safeAddress, activeTokens.push(token.toJS())) setToken(safeAddress, token) } diff --git a/src/logic/tokens/utils/tokensStorage.js b/src/logic/tokens/utils/tokensStorage.js index 692db811..0af8417a 100644 --- a/src/logic/tokens/utils/tokensStorage.js +++ b/src/logic/tokens/utils/tokensStorage.js @@ -10,7 +10,7 @@ export const CUSTOM_TOKENS_KEY = 'CUSTOM_TOKENS' // to avoid iterating a large amount of data of tokens from the backend // Custom tokens should be saved too unless they're deleted (marking them as inactive doesn't count) -export const setActiveTokens = async (tokens: Map) => { +export const saveActiveTokens = async (tokens: Map) => { try { await saveToStorage(ACTIVE_TOKENS_KEY, tokens.toJS()) } catch (err) { @@ -59,6 +59,6 @@ export const removeFromActiveTokens = async (safeAddress: string, token: Token) const index = activeTokens.findIndex(activeToken => activeToken.name === token.name) if (index !== -1) { - await setActiveTokens(safeAddress, activeTokens.delete(index)) + await saveActiveTokens(safeAddress, activeTokens.delete(index)) } } diff --git a/src/routes/safe/store/actions/updateSafes.js b/src/routes/safe/store/actions/updateSafes.js deleted file mode 100644 index bdcfad65..00000000 --- a/src/routes/safe/store/actions/updateSafes.js +++ /dev/null @@ -1,8 +0,0 @@ -// @flow -import { createAction } from 'redux-actions' - -export const UPDATE_SAFES = 'UPDATE_SAFES' - -const updateSafesInBatch = createAction(UPDATE_SAFES) - -export default updateSafesInBatch diff --git a/src/routes/safe/store/middleware/safeStorage.js b/src/routes/safe/store/middleware/safeStorage.js index ab765e18..3104687b 100644 --- a/src/routes/safe/store/middleware/safeStorage.js +++ b/src/routes/safe/store/middleware/safeStorage.js @@ -8,7 +8,7 @@ import { safesMapSelector } from '~/routes/safeList/store/selectors' import { getActiveTokensAddressesForAllSafes } from '~/routes/safe/store/selectors' import { tokensSelector } from '~/logic/tokens/store/selectors' import type { Token } from '~/logic/tokens/store/model/token' -import { setActiveTokens } from '~/logic/tokens/utils/tokensStorage' +import { saveActiveTokens } from '~/logic/tokens/utils/tokensStorage' const watchedActions = [ADD_SAFE, UPDATE_SAFE] @@ -33,7 +33,7 @@ const safeStorageMware = (store: Store) => (next: Function) => asyn }) }) - setActiveTokens(activeTokens) + saveActiveTokens(activeTokens) } if (action.type === ADD_SAFE) {