Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
refactor: remove lodash findkey (#1894)
Browse files Browse the repository at this point in the history
  • Loading branch information
brenopolanski authored Apr 9, 2020
1 parent 40d0481 commit ab96104
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/renderer/components/Selection/SelectionTheme.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
<script>
import { ButtonSwitch } from '@/components/Button'
import { SvgIcon } from '@/components/SvgIcon'
import { findKey } from 'lodash'
export default {
name: 'SelectionTheme',
Expand Down Expand Up @@ -54,7 +53,7 @@ export default {
methods: {
emitInput (status) {
const theme = findKey(this.$options.themes, item => item === status)
const theme = Object.keys(this.$options.themes).find(theme => this.$options.themes[theme] === status)
this.$emit('input', theme)
}
}
Expand Down
10 changes: 7 additions & 3 deletions src/renderer/components/Transaction/TransactionModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</template>

<script>
import { camelCase, includes, findKey } from 'lodash'
import { camelCase, includes } from 'lodash'
import { upperFirst } from '@/utils'
import { TRANSACTION_GROUPS, TRANSACTION_TYPES } from '@config'
import MultiSignature from '@/services/client-multisig'
Expand Down Expand Up @@ -105,7 +105,9 @@ export default {
return 'MULTI_SIGN'
}
const key = findKey(TRANSACTION_TYPES[`GROUP_${this.group}`], type => this.type === type)
const transactionTypes = TRANSACTION_TYPES[`GROUP_${this.group}`]
const key = Object.keys(transactionTypes).find(type => transactionTypes[type] === this.type)
if (key === 'VOTE' && this.transaction.asset.votes.length) {
if (this.transaction.asset.votes[0].substring(0, 1) === '-') {
return 'UNVOTE'
Expand All @@ -119,7 +121,9 @@ export default {
return 'TransactionModalMultiSign'
}
const type = findKey(TRANSACTION_TYPES[`GROUP_${this.group}`], type => this.type === type)
const transactionTypes = TRANSACTION_TYPES[`GROUP_${this.group}`]
const type = Object.keys(transactionTypes).find(type => transactionTypes[type] === this.type)
return `TransactionModal${upperFirst(camelCase(type))}`
},
typeName () {
Expand Down

0 comments on commit ab96104

Please sign in to comment.