Skip to content

Commit

Permalink
Merge pull request #796 from Keith-CY/remove-quotation-mark-in-top-alert
Browse files Browse the repository at this point in the history
fix(neuron-ui): remove the quotation mark around error message
  • Loading branch information
ashchan authored Aug 1, 2019
2 parents c821894 + 5de8cba commit 630c6f1
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 630c6f1

Please sign in to comment.