2019-10-21 20:12:43 -04:00
|
|
|
import * as MODALS from 'constants/modal_types';
|
2017-12-21 18:08:54 -03:00
|
|
|
import { connect } from 'react-redux';
|
2018-10-29 13:23:53 -04:00
|
|
|
import { selectDaemonVersionMatched, selectModal } from 'redux/selectors/app';
|
2019-10-21 20:12:43 -04:00
|
|
|
import { doCheckDaemonVersion, doOpenModal, doHideModal } from 'redux/actions/app';
|
2019-12-11 15:09:27 -05:00
|
|
|
import { doSetClientSetting, doClearDaemonSetting } from 'redux/actions/settings';
|
2019-08-08 16:30:03 -04:00
|
|
|
import * as settings from 'constants/settings';
|
2019-12-11 15:09:27 -05:00
|
|
|
import { doToast, DAEMON_SETTINGS } from 'lbry-redux';
|
2017-12-21 18:08:54 -03:00
|
|
|
import SplashScreen from './view';
|
2017-07-19 17:05:08 -04:00
|
|
|
|
2019-08-08 16:30:03 -04:00
|
|
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
|
|
|
|
2017-12-13 18:36:30 -03:00
|
|
|
const select = state => ({
|
2018-10-29 13:23:53 -04:00
|
|
|
modal: selectModal(state),
|
2017-12-13 18:36:30 -03:00
|
|
|
daemonVersionMatched: selectDaemonVersionMatched(state),
|
2019-08-08 16:30:03 -04:00
|
|
|
animationHidden: makeSelectClientSetting(settings.HIDE_SPLASH_ANIMATION)(state),
|
2017-12-13 18:36:30 -03:00
|
|
|
});
|
2017-07-19 17:05:08 -04:00
|
|
|
|
|
|
|
const perform = dispatch => ({
|
|
|
|
checkDaemonVersion: () => dispatch(doCheckDaemonVersion()),
|
2019-10-21 20:12:43 -04:00
|
|
|
notifyUnlockWallet: shouldTryWithBlankPassword =>
|
|
|
|
dispatch(doOpenModal(MODALS.WALLET_UNLOCK, { shouldTryWithBlankPassword })),
|
2019-01-09 20:38:26 -05:00
|
|
|
hideModal: () => dispatch(doHideModal()),
|
2019-08-08 16:30:03 -04:00
|
|
|
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
2019-12-11 15:09:27 -05:00
|
|
|
clearWalletServers: () => dispatch(doClearDaemonSetting(DAEMON_SETTINGS.LBRYUM_SERVERS)),
|
|
|
|
doShowSnackBar: message => dispatch(doToast({ isError: true, message })),
|
2017-07-19 17:05:08 -04:00
|
|
|
});
|
|
|
|
|
2018-07-18 15:48:30 -04:00
|
|
|
export default connect(
|
|
|
|
select,
|
|
|
|
perform
|
|
|
|
)(SplashScreen);
|