lbry-desktop/ui/component/splash/index.js

27 lines
1.2 KiB
JavaScript
Raw Permalink Normal View History

2019-10-22 02:12:43 +02:00
import * as MODALS from 'constants/modal_types';
import { connect } from 'react-redux';
2020-11-09 18:22:38 +01: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';
import { doToast } from 'redux/actions/notifications';
import SplashScreen from './view';
2017-12-13 22:36:30 +01:00
const select = state => ({
modal: selectModal(state),
2017-12-13 22:36:30 +01:00
daemonVersionMatched: selectDaemonVersionMatched(state),
2020-11-09 18:22:38 +01:00
animationHidden: selectSplashAnimationEnabled(state),
2017-12-13 22:36:30 +01:00
});
const perform = dispatch => ({
checkDaemonVersion: () => dispatch(doCheckDaemonVersion()),
2019-10-22 02:12:43 +02:00
notifyUnlockWallet: shouldTryWithBlankPassword =>
dispatch(doOpenModal(MODALS.WALLET_UNLOCK, { shouldTryWithBlankPassword })),
hideModal: () => dispatch(doHideModal()),
2020-11-09 18:22:38 +01:00
toggleSplashAnimation: () => dispatch(doToggleSplashAnimation()),
clearWalletServers: () => dispatch(doClearDaemonSetting(DAEMON_SETTINGS.LBRYUM_SERVERS)),
doShowSnackBar: message => dispatch(doToast({ isError: true, message })),
});
export default connect(select, perform)(SplashScreen);