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