2017-05-26 06:20:00 +00:00
|
|
|
import { createStructuredSelector } from 'reselect';
|
2017-06-21 06:40:28 +00:00
|
|
|
import Settings from 'components/pages/Settings';
|
2018-11-10 11:18:45 +00:00
|
|
|
import { appSet } from 'state/app';
|
2018-10-15 06:56:17 +00:00
|
|
|
import {
|
|
|
|
getSettings,
|
|
|
|
setSetting,
|
|
|
|
setCert,
|
|
|
|
setKey,
|
|
|
|
uploadCert
|
|
|
|
} from 'state/settings';
|
2018-11-09 07:11:01 +00:00
|
|
|
import connect from 'utils/connect';
|
2016-01-11 20:04:57 +00:00
|
|
|
|
2017-05-26 06:20:00 +00:00
|
|
|
const mapState = createStructuredSelector({
|
2018-11-10 11:18:45 +00:00
|
|
|
settings: getSettings,
|
2018-11-22 11:00:18 +00:00
|
|
|
installable: state => state.app.installable,
|
|
|
|
version: state => state.app.version
|
2017-05-26 06:20:00 +00:00
|
|
|
});
|
|
|
|
|
2017-06-29 05:11:12 +00:00
|
|
|
const mapDispatch = {
|
|
|
|
onCertChange: setCert,
|
|
|
|
onKeyChange: setKey,
|
2018-10-15 06:56:17 +00:00
|
|
|
uploadCert,
|
2018-11-10 11:18:45 +00:00
|
|
|
setSetting,
|
|
|
|
onInstall: () => appSet('installable', null)
|
2017-06-29 05:11:12 +00:00
|
|
|
};
|
2017-05-27 05:30:22 +00:00
|
|
|
|
2018-05-28 01:16:05 +00:00
|
|
|
export default connect(
|
|
|
|
mapState,
|
|
|
|
mapDispatch
|
|
|
|
)(Settings);
|