Skip to content

Commit 5de8cba

Browse files
committed
fix(neuron-ui): remove the quotation mark around error message
1 parent 73bd7af commit 5de8cba

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

packages/neuron-ui/src/services/remote/controllerMethodWrapper.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,17 @@ export const controllerMethodWrapper = (controllerName: string) => (
5656
result: res.result || null,
5757
}
5858
}
59+
60+
let title = ''
61+
62+
if (typeof res === 'string') {
63+
title = res
64+
} else if (typeof res.msg === 'string') {
65+
title = res.msg
66+
}
5967
return {
6068
status: 0,
61-
message: { title: (res && res.msg) || '' },
69+
message: { title },
6270
}
6371
}
6472

packages/neuron-ui/src/states/stateProvider/actionCreators/wallets.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ export const sendTransaction = (params: Controller.SendTransaction) => (dispatch
113113
if (res.status) {
114114
history.push(Routes.History)
115115
} else {
116-
addNotification({ type: 'alert', content: JSON.stringify(res.message.title) })(dispatch)
116+
// TODO: the pretreatment is unnecessary once the error code is implemented
117+
addNotification({ type: 'alert', content: res.message.title.replace(/(\b"|"\b)/g, '') })(dispatch)
117118
}
118119
dispatch({
119120
type: AppActions.DismissPasswordRequest,

0 commit comments

Comments
 (0)