mirror of
https://github.com/wassname/talk.git
synced 2026-07-12 06:20:11 +08:00
Merge pull request #310 from coralproject/close-time-bug
fix Configure in admin
This commit is contained in:
@@ -39,7 +39,7 @@ export const updateDomainlist = (listName, list) => {
|
||||
};
|
||||
|
||||
export const saveSettingsToServer = () => (dispatch, getState) => {
|
||||
let settings = getState().settings.toJS().settings;
|
||||
let settings = getState().settings.toJS();
|
||||
if (settings.charCount) {
|
||||
settings.charCount = parseInt(settings.charCount);
|
||||
}
|
||||
|
||||
@@ -165,7 +165,9 @@ class Configure extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
const mapStateToProps = state => state.settings.toJS();
|
||||
const mapStateToProps = state => ({
|
||||
settings: state.settings.toJS()
|
||||
});
|
||||
export default connect(mapStateToProps)(Configure);
|
||||
|
||||
const lang = new I18n(translations);
|
||||
|
||||
@@ -2,14 +2,12 @@ import {Map, List} from 'immutable';
|
||||
import * as actions from '../actions/settings';
|
||||
|
||||
const initialState = Map({
|
||||
settings: Map({
|
||||
wordlist: Map({
|
||||
banned: List(),
|
||||
suspect: List()
|
||||
}),
|
||||
domains: Map({
|
||||
whitelist: List()
|
||||
})
|
||||
wordlist: Map({
|
||||
banned: List(),
|
||||
suspect: List()
|
||||
}),
|
||||
domains: Map({
|
||||
whitelist: List()
|
||||
}),
|
||||
saveSettingsError: null,
|
||||
fetchSettingsError: null,
|
||||
@@ -54,10 +52,10 @@ export default function settings (state = initialState, action) {
|
||||
.set('fetchSettingsError', action.error);
|
||||
case actions.WORDLIST_UPDATED:
|
||||
return state
|
||||
.setIn(['settings', 'wordlist', action.listName], action.list);
|
||||
.setIn(['wordlist', action.listName], action.list);
|
||||
case actions.DOMAINLIST_UPDATED:
|
||||
return state
|
||||
.setIn(['settings', 'domains', action.listName], action.list);
|
||||
.setIn(['domains', action.listName], action.list);
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user