2019-09-26 18:07:11 +02:00
|
|
|
import * as SETTINGS from 'constants/settings';
|
2019-03-05 07:24:03 +01:00
|
|
|
import { hot } from 'react-hot-loader/root';
|
2017-12-21 22:08:54 +01:00
|
|
|
import { connect } from 'react-redux';
|
2019-09-26 18:28:08 +02:00
|
|
|
import { selectUser, doRewardList, doFetchRewardedContent, doFetchAccessToken } from 'lbryinc';
|
2019-09-26 18:07:11 +02:00
|
|
|
import { doFetchTransactions, doFetchChannelListMine } from 'lbry-redux';
|
2019-09-04 23:43:37 +02:00
|
|
|
import { makeSelectClientSetting, selectThemePath } from 'redux/selectors/settings';
|
2019-09-23 03:56:43 +02:00
|
|
|
import { selectIsUpgradeAvailable, selectAutoUpdateDownloaded } from 'redux/selectors/app';
|
2019-09-26 18:07:11 +02:00
|
|
|
import { doDownloadUpgradeRequested, doSignIn } from 'redux/actions/app';
|
2017-12-21 22:08:54 +01:00
|
|
|
import App from './view';
|
2017-04-07 07:15:22 +02:00
|
|
|
|
2018-03-26 23:32:43 +02:00
|
|
|
const select = state => ({
|
2017-07-28 03:13:12 +02:00
|
|
|
user: selectUser(state),
|
2018-10-19 17:27:14 +02:00
|
|
|
theme: selectThemePath(state),
|
2019-09-04 23:43:37 +02:00
|
|
|
language: makeSelectClientSetting(SETTINGS.LANGUAGE)(state),
|
2019-09-23 03:56:43 +02:00
|
|
|
autoUpdateDownloaded: selectAutoUpdateDownloaded(state),
|
|
|
|
isUpgradeAvailable: selectIsUpgradeAvailable(state),
|
2017-07-28 03:13:12 +02:00
|
|
|
});
|
2017-04-07 07:15:22 +02:00
|
|
|
|
2017-06-06 06:21:55 +02:00
|
|
|
const perform = dispatch => ({
|
2019-06-11 20:10:58 +02:00
|
|
|
fetchRewards: () => dispatch(doRewardList()),
|
|
|
|
fetchRewardedContent: () => dispatch(doFetchRewardedContent()),
|
2019-06-27 08:18:45 +02:00
|
|
|
fetchTransactions: () => dispatch(doFetchTransactions()),
|
2019-08-06 18:53:59 +02:00
|
|
|
fetchAccessToken: () => dispatch(doFetchAccessToken()),
|
2019-09-26 18:28:08 +02:00
|
|
|
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
|
|
|
onSignedIn: () => dispatch(doSignIn()),
|
2019-09-23 03:56:43 +02:00
|
|
|
requestDownloadUpgrade: () => dispatch(doDownloadUpgradeRequested()),
|
2019-09-26 18:07:11 +02:00
|
|
|
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
|
|
|
onSignedIn: () => dispatch(doSignIn()),
|
2017-06-06 06:21:55 +02:00
|
|
|
});
|
2017-04-07 07:15:22 +02:00
|
|
|
|
2019-03-05 07:24:03 +01:00
|
|
|
export default hot(
|
|
|
|
connect(
|
|
|
|
select,
|
|
|
|
perform
|
|
|
|
)(App)
|
|
|
|
);
|