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';
|
2020-11-09 12:22:38 -05:00
|
|
|
import { selectDaemonVersionMatched, selectModal, selectSplashAnimationEnabled } from 'redux/selectors/app';
|
|
|
|
import { doCheckDaemonVersion, doOpenModal, doHideModal, doToggleSplashAnimation } from 'redux/actions/app';
|
|
|
|
import { doClearDaemonSetting } from 'redux/actions/settings';
|
|
|
|
import { DAEMON_SETTINGS } from 'lbry-redux';
|
2020-06-12 16:44:25 -04:00
|
|
|
import { doToast } from 'redux/actions/notifications';
|
2017-12-21 18:08:54 -03:00
|
|
|
import SplashScreen from './view';
|
2017-07-19 17:05:08 -04:00
|
|
|
|
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),
|
2020-11-09 12:22:38 -05:00
|
|
|
animationHidden: selectSplashAnimationEnabled(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()),
|
2020-11-09 12:22:38 -05:00
|
|
|
toggleSplashAnimation: () => dispatch(doToggleSplashAnimation()),
|
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
|
|
|
});
|
|
|
|
|
2020-06-12 16:44:25 -04:00
|
|
|
export default connect(select, perform)(SplashScreen);
|