lbry-desktop/ui/component/splash/index.js
2020-06-16 09:56:32 -04:00

29 lines
1.3 KiB
JavaScript

import * as MODALS from 'constants/modal_types';
import { connect } from 'react-redux';
import { selectDaemonVersionMatched, selectModal } from 'redux/selectors/app';
import { doCheckDaemonVersion, doOpenModal, doHideModal } from 'redux/actions/app';
import { doSetClientSetting, doClearDaemonSetting } from 'redux/actions/settings';
import * as settings from 'constants/settings';
import { DAEMON_SETTINGS } from 'lbry-redux';
import { doToast } from 'redux/actions/notifications';
import SplashScreen from './view';
import { makeSelectClientSetting } from 'redux/selectors/settings';
const select = state => ({
modal: selectModal(state),
daemonVersionMatched: selectDaemonVersionMatched(state),
animationHidden: makeSelectClientSetting(settings.HIDE_SPLASH_ANIMATION)(state),
});
const perform = dispatch => ({
checkDaemonVersion: () => dispatch(doCheckDaemonVersion()),
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);