2019-10-22 02:12:43 +02:00
|
|
|
import * as MODALS from 'constants/modal_types';
|
2017-12-21 22:08:54 +01:00
|
|
|
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';
|
2022-08-09 23:21:43 +02:00
|
|
|
import { doFetchModBlockedList } from 'redux/actions/comments';
|
2020-11-09 18:22:38 +01:00
|
|
|
import { doClearDaemonSetting } from 'redux/actions/settings';
|
2021-10-08 05:47:39 +02:00
|
|
|
import * as DAEMON_SETTINGS from 'constants/daemon_settings';
|
2020-06-12 22:44:25 +02:00
|
|
|
import { doToast } from 'redux/actions/notifications';
|
2017-12-21 22:08:54 +01:00
|
|
|
import SplashScreen from './view';
|
2017-07-19 23:05:08 +02:00
|
|
|
|
2021-10-08 05:47:39 +02:00
|
|
|
const select = (state) => ({
|
2018-10-29 18:23:53 +01:00
|
|
|
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
|
|
|
});
|
2017-07-19 23:05:08 +02:00
|
|
|
|
2021-10-08 05:47:39 +02:00
|
|
|
const perform = (dispatch) => ({
|
2017-07-19 23:05:08 +02:00
|
|
|
checkDaemonVersion: () => dispatch(doCheckDaemonVersion()),
|
2021-10-08 05:47:39 +02:00
|
|
|
notifyUnlockWallet: (shouldTryWithBlankPassword) =>
|
2019-10-22 02:12:43 +02:00
|
|
|
dispatch(doOpenModal(MODALS.WALLET_UNLOCK, { shouldTryWithBlankPassword })),
|
2019-01-10 02:38:26 +01:00
|
|
|
hideModal: () => dispatch(doHideModal()),
|
2020-11-09 18:22:38 +01:00
|
|
|
toggleSplashAnimation: () => dispatch(doToggleSplashAnimation()),
|
2019-12-11 21:09:27 +01:00
|
|
|
clearWalletServers: () => dispatch(doClearDaemonSetting(DAEMON_SETTINGS.LBRYUM_SERVERS)),
|
2021-10-08 05:47:39 +02:00
|
|
|
doShowSnackBar: (message) => dispatch(doToast({ isError: true, message })),
|
2022-08-09 23:21:43 +02:00
|
|
|
fetchModBlockedList: () => dispatch(doFetchModBlockedList()),
|
2017-07-19 23:05:08 +02:00
|
|
|
});
|
|
|
|
|
2020-06-12 22:44:25 +02:00
|
|
|
export default connect(select, perform)(SplashScreen);
|