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

29 lines
1.4 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 { doFetchModBlockedList } from 'redux/actions/comments';
2020-11-09 18:22:38 +01:00
import { doClearDaemonSetting } from 'redux/actions/settings';
import * as DAEMON_SETTINGS from 'constants/daemon_settings';
import { doToast } from 'redux/actions/notifications';
import SplashScreen from './view';
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()),
notifyUnlockWallet: (shouldTryWithBlankPassword) =>
2019-10-22 02:12:43 +02:00
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 })),
fetchModBlockedList: () => dispatch(doFetchModBlockedList()),
});
export default connect(select, perform)(SplashScreen);