Skip to content

Commit 2b8ce38

Browse files
authored
Merge pull request #122 from bitholla/refinement
fix for admin links and broker fees
2 parents 5f912a1 + 13ca1df commit 2b8ce38

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

web/src/containers/Admin/Broker/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const Broker = () => {
4949
});
5050
getFees()
5151
.then(res => {
52-
if (res.trades)
52+
if (res)
5353
setFees(res);
5454
})
5555
.catch(error => {
@@ -151,13 +151,13 @@ const Broker = () => {
151151
fields={generateForm()}
152152
handleSubmitBroker={handleSubmitBroker}
153153
/>
154-
{feesData.trades
154+
{Object.keys(feesData).length
155155
? <Card
156156
className="card-title m-top"
157157
title="Quick Trades Fees"
158158
style={{ textAlign: 'center' }}
159159
>
160-
{Object.entries(feesData.trades).map(([currency, amount], index) => (
160+
{Object.entries(feesData).map(([currency, amount], index) => (
161161
<div
162162
key={index}
163163
className="list-group-item list-group-item-action"

web/src/containers/Admin/Settings/SettingsForm.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { Divider, Button } from 'antd';
3-
import { reduxForm } from 'redux-form';
3+
import { reduxForm, reset } from 'redux-form';
44

55
import { AdminHocForm } from '../../../components';
66
import { generateAdminSettings } from './Utils';
@@ -138,6 +138,6 @@ const LinksForm = ({
138138
export const LinksSettingsForm = reduxForm({
139139
form: 'ADMIN_LINKS_SETTINGS_FORM',
140140
// onSubmitFail: (result, dispatch) => dispatch(reset(FORM_NAME)),
141-
// onSubmitSuccess: (result, dispatch) => dispatch(reset(name)),
141+
onSubmitSuccess: (result, dispatch) => dispatch(reset('ADMIN_LINKS_SETTINGS_FORM')),
142142
enableReinitialize: true
143143
})(LinksForm);

web/src/containers/Admin/Settings/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ export default class Settings extends Component {
164164
formValues[val] = formProps[val];
165165
}
166166
});
167+
} else if (formKey === 'links') {
168+
formValues.links = { ...formProps }
167169
}
168170
this.setState({ loading: true, error: '' });
169171
updatePlugins(formValues)

0 commit comments

Comments
 (0)