Skip to content

Commit

Permalink
fix(neuron-ui): remove the quotation mark around error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith-CY committed Aug 1, 2019
1 parent 73bd7af commit 5de8cba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,17 @@ export const controllerMethodWrapper = (controllerName: string) => (
result: res.result || null,
}
}

let title = ''

if (typeof res === 'string') {
title = res
} else if (typeof res.msg === 'string') {
title = res.msg
}
return {
status: 0,
message: { title: (res && res.msg) || '' },
message: { title },
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ export const sendTransaction = (params: Controller.SendTransaction) => (dispatch
if (res.status) {
history.push(Routes.History)
} else {
addNotification({ type: 'alert', content: JSON.stringify(res.message.title) })(dispatch)
// TODO: the pretreatment is unnecessary once the error code is implemented
addNotification({ type: 'alert', content: res.message.title.replace(/(\b"|"\b)/g, '') })(dispatch)
}
dispatch({
type: AppActions.DismissPasswordRequest,
Expand Down

0 comments on commit 5de8cba

Please sign in to comment.