Skip to content

Commit

Permalink
fix(BCH): xing out of bch wallet label change should not alert error
Browse files Browse the repository at this point in the history
  • Loading branch information
plondon committed May 15, 2018
1 parent b98add6 commit 3ff9bd1
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import * as AT from './actionTypes'

export const editBchHdLabel = (accountIdx, addressIdx) => ({ type: AT.EDIT_BCH_HD_LABEL, payload: { accountIdx, addressIdx } })

export const editBchAccountLabel = (index, label) => ({ type: AT.EDIT_BCH_ACCOUNT_LABEL, payload: { index, label } })
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export default ({ coreSagas }) => {
const addressesBchSagas = sagas({ coreSagas })

return function * () {
yield takeEvery(AT.EDIT_BCH_HD_LABEL, addressesBchSagas.editBchHdLabel)
yield takeEvery(AT.EDIT_BCH_ACCOUNT_LABEL, addressesBchSagas.editBchAccountLabel)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,13 @@ export default ({ coreSagas }) => {
yield put(actions.core.kvStore.bch.setAccountLabel(index, newLabel))
yield put(actions.alerts.displaySuccess('BCH wallet name updated.'))
} catch (e) {
if (e.message === 'PROMPT_INPUT_CANCEL') return
yield put(actions.logs.logErrorMessage(logLocation, 'editBchAccountLabel', e))
yield put(actions.alerts.displayError('Failed to update Bitcoin Cash account label.'))
}
}

const editBchHdLabel = function * (action) {
try {
let { accountIdx, addressIdx } = action.payload
let newLabel = yield call(promptForInput, { title: 'Rename Address Label' })
yield put(actions.core.kvStore.bch.setHdAddressLabel(accountIdx, addressIdx, newLabel))
yield put(actions.alerts.displaySuccess('Address label updated.'))
} catch (e) {
yield put(actions.logs.logErrorMessage(logLocation, 'editBchHdLabel', e))
yield put(actions.alerts.displayError('Failed to update Bitcoin Cash account label.'))
}
}

return {
editBchHdLabel,
editBchAccountLabel
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ const WalletLayout = props => {
{ location.pathname === '/bch/transactions' && <BchMenu /> }
{ location.pathname === '/eth/transactions' && <EthMenu /> }
{ location.pathname === '/settings/addresses' && <AddrMenu /> }
{ location.pathname === '/settings/addresses/bch' && <AddrMenu /> }
<Page>
{children}
</Page>
Expand Down

0 comments on commit 3ff9bd1

Please sign in to comment.