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