From 93678064d967094eb60e460d3f82c33be0e01ec8 Mon Sep 17 00:00:00 2001 From: Mikhail Mikheev Date: Fri, 28 Jun 2019 14:24:20 +0400 Subject: [PATCH] remove accesing owner props via .get() since it's a record --- src/components/layout/Img/index.jsx | 2 +- src/logic/safe/utils/safeStorage.js | 2 +- .../AddOwnerModal/screens/Review/index.jsx | 10 +++++----- .../RemoveOwnerModal/screens/Review/index.jsx | 10 +++++----- .../ReplaceOwnerModal/screens/Review/index.jsx | 10 +++++----- .../components/Settings/ManageOwners/dataFetcher.js | 4 ++-- src/routes/safe/container/selector.js | 2 +- src/store/index.js | 2 +- src/test/safe.dom.funds.test.js | 2 +- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/components/layout/Img/index.jsx b/src/components/layout/Img/index.jsx index 45405cb4..94dbd5f4 100644 --- a/src/components/layout/Img/index.jsx +++ b/src/components/layout/Img/index.jsx @@ -11,7 +11,7 @@ type Props = { bordered?: boolean, className?: string, style?: Object, - testId? : string, + testId?: string, } const Img = ({ diff --git a/src/logic/safe/utils/safeStorage.js b/src/logic/safe/utils/safeStorage.js index 3a5ad40e..37a6fb27 100644 --- a/src/logic/safe/utils/safeStorage.js +++ b/src/logic/safe/utils/safeStorage.js @@ -28,7 +28,7 @@ export const saveSafes = async (safes: Object) => { export const setOwners = async (safeAddress: string, owners: List) => { try { - const ownersAsMap = Map(owners.map((owner: Owner) => [owner.get('address').toLowerCase(), owner.get('name')])) + const ownersAsMap = Map(owners.map((owner: Owner) => [owner.address.toLowerCase(), owner.name])) await saveToStorage(`${OWNERS_KEY}-${safeAddress}`, ownersAsMap) } catch (err) { // eslint-disable-next-line diff --git a/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/Review/index.jsx b/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/Review/index.jsx index b9252b0a..70b2f562 100644 --- a/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/Review/index.jsx +++ b/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/Review/index.jsx @@ -98,21 +98,21 @@ const ReviewAddOwner = ({ {owners.map(owner => ( - + - + - {owner.get('name')} + {owner.name} - {owner.get('address')} + {owner.address} - + diff --git a/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/Review/index.jsx b/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/Review/index.jsx index 993f04b5..15f73587 100644 --- a/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/Review/index.jsx +++ b/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/Review/index.jsx @@ -109,23 +109,23 @@ const ReviewRemoveOwner = ({ {owners.map( owner => owner.address !== ownerAddress && ( - + - + - {owner.get('name')} + {owner.name} - {owner.get('address')} + {owner.address} diff --git a/src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/Review/index.jsx b/src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/Review/index.jsx index 1b960669..e8469b17 100644 --- a/src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/Review/index.jsx +++ b/src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/Review/index.jsx @@ -111,23 +111,23 @@ const ReviewRemoveOwner = ({ {owners.map( owner => owner.address !== ownerAddress && ( - + - + - {owner.get('name')} + {owner.name} - {owner.get('address')} + {owner.address} diff --git a/src/routes/safe/components/Settings/ManageOwners/dataFetcher.js b/src/routes/safe/components/Settings/ManageOwners/dataFetcher.js index f66e4489..9575d735 100644 --- a/src/routes/safe/components/Settings/ManageOwners/dataFetcher.js +++ b/src/routes/safe/components/Settings/ManageOwners/dataFetcher.js @@ -17,8 +17,8 @@ export type OwnerRow = SortRow export const getOwnerData = (owners: List): List => { const rows = owners.map((owner: Owner) => ({ - [OWNERS_TABLE_NAME_ID]: owner.get('name'), - [OWNERS_TABLE_ADDRESS_ID]: owner.get('address'), + [OWNERS_TABLE_NAME_ID]: owner.name, + [OWNERS_TABLE_ADDRESS_ID]: owner.address, })) return rows diff --git a/src/routes/safe/container/selector.js b/src/routes/safe/container/selector.js index 14db2918..fc3bcf0e 100644 --- a/src/routes/safe/container/selector.js +++ b/src/routes/safe/container/selector.js @@ -46,7 +46,7 @@ export const grantedSelector: Selector = crea return false } - return owners.find((owner: Owner) => sameAddress(owner.get('address'), userAccount)) !== undefined + return owners.find((owner: Owner) => sameAddress(owner.address, userAccount)) !== undefined }, ) diff --git a/src/store/index.js b/src/store/index.js index bad964d4..9542511c 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -39,4 +39,4 @@ const reducers: Reducer = combineReducers({ export const store: Store = createStore(reducers, finalCreateStore) -export const aNewStore = (localState?: Object): Store => createStore(reducers, localState, finalCreateStore) \ No newline at end of file +export const aNewStore = (localState?: Object): Store => createStore(reducers, localState, finalCreateStore) diff --git a/src/test/safe.dom.funds.test.js b/src/test/safe.dom.funds.test.js index 974f3a93..4e245ed1 100644 --- a/src/test/safe.dom.funds.test.js +++ b/src/test/safe.dom.funds.test.js @@ -119,4 +119,4 @@ describe('DOM > Feature > Funds', () => { const receiverFunds = await calculateBalanceOf(tokenAddress, tokenReceiver, 18) expect(receiverFunds).toBe(tokensAmount) }) -}) \ No newline at end of file +})