2021-07-25 14:52:45 +02:00
|
|
|
import { connect } from 'react-redux';
|
2021-10-08 05:47:39 +02:00
|
|
|
import * as SETTINGS from 'constants/settings';
|
2021-07-25 14:52:45 +02:00
|
|
|
import { doSetClientSetting } from 'redux/actions/settings';
|
|
|
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
|
|
|
import SettingCommentsServer from './view';
|
|
|
|
|
|
|
|
const select = (state) => ({
|
|
|
|
customServerEnabled: makeSelectClientSetting(SETTINGS.CUSTOM_COMMENTS_SERVER_ENABLED)(state),
|
|
|
|
customServerUrl: makeSelectClientSetting(SETTINGS.CUSTOM_COMMENTS_SERVER_URL)(state),
|
2022-02-02 07:19:39 +01:00
|
|
|
customCommentServers: makeSelectClientSetting(SETTINGS.CUSTOM_COMMENTS_SERVERS)(state),
|
2021-07-25 14:52:45 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
const perform = (dispatch) => ({
|
|
|
|
setCustomServerEnabled: (val) => dispatch(doSetClientSetting(SETTINGS.CUSTOM_COMMENTS_SERVER_ENABLED, val, true)),
|
|
|
|
setCustomServerUrl: (url) => dispatch(doSetClientSetting(SETTINGS.CUSTOM_COMMENTS_SERVER_URL, url, true)),
|
2022-02-02 07:19:39 +01:00
|
|
|
setCustomServers: (servers) => dispatch(doSetClientSetting(SETTINGS.CUSTOM_COMMENTS_SERVERS, servers, true)),
|
2021-07-25 14:52:45 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(select, perform)(SettingCommentsServer);
|