Skip to content

Commit

Permalink
chore(settigs): do not rerender if pairing flag does not change (#6276)
Browse files Browse the repository at this point in the history
  • Loading branch information
mperdomo-bc committed Feb 6, 2024
1 parent 4789fda commit 1abd495
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ const PairingCode = () => {
const dispatch = useDispatch()

const onShowCode = () => {
dispatch(
modals.showModal(ModalName.PAIRING_CODE_MODAL, {
origin: 'SettingsPage'
})
)
dispatch(modals.showModal(ModalName.PAIRING_CODE_MODAL, { origin: 'SettingsPage' }))
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { FormattedMessage } from 'react-intl'
import { useSelector } from 'react-redux'
import styled from 'styled-components'

import { getPairingCodeFlag } from '@core/redux/walletOptions/selectors'
import { Text } from 'blockchain-info-components'
import MenuHeader from 'components/MenuHeader'
import { selectors } from 'data'

import About from './About'
import LinkedBanks from './LinkedBanks'
Expand All @@ -22,9 +22,10 @@ const Title = styled(Text)`
`

const General = () => {
const showPairingCode = useSelector(selectors.core.walletOptions.getPairingCodeFlag).getOrElse(
false
)
const showPairingCode = useSelector(
getPairingCodeFlag,
(prev, next) => prev.data === next.data
).getOrElse(false)

return (
<section>
Expand Down

0 comments on commit 1abd495

Please sign in to comment.