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

29 lines
1.3 KiB
JavaScript
Raw Normal View History

2019-10-22 02:12:43 +02:00
import * as MODALS from 'constants/modal_types';
import { connect } from 'react-redux';
import { selectDaemonVersionMatched, selectModal } from 'redux/selectors/app';
2019-10-22 02:12:43 +02:00
import { doCheckDaemonVersion, doOpenModal, doHideModal } from 'redux/actions/app';
import { doSetClientSetting, doClearDaemonSetting } from 'redux/actions/settings';
import { DAEMON_SETTINGS, SETTINGS } from 'lbry-redux';
import { doToast } from 'redux/actions/notifications';
import SplashScreen from './view';
import { makeSelectClientSetting } from 'redux/selectors/settings';
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),
animationHidden: makeSelectClientSetting(SETTINGS.HIDE_SPLASH_ANIMATION)(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()),
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
clearWalletServers: () => dispatch(doClearDaemonSetting(DAEMON_SETTINGS.LBRYUM_SERVERS)),
doShowSnackBar: message => dispatch(doToast({ isError: true, message })),
});
export default connect(select, perform)(SplashScreen);