2021-08-06 04:41:37 +02:00
|
|
|
import { connect } from 'react-redux';
|
2021-10-17 10:36:14 +02:00
|
|
|
import { selectMyChannelUrls } from 'redux/selectors/claims';
|
|
|
|
import * as SETTINGS from 'constants/settings';
|
2021-08-06 04:41:37 +02:00
|
|
|
import { doOpenModal } from 'redux/actions/app';
|
|
|
|
import { doSetPlayingUri } from 'redux/actions/content';
|
2022-03-17 01:23:16 +01:00
|
|
|
import { doFetchPersonalRecommendations } from 'redux/actions/search';
|
2021-08-06 04:41:37 +02:00
|
|
|
import { doSetClientSetting } from 'redux/actions/settings';
|
2022-03-17 01:23:16 +01:00
|
|
|
import { selectPersonalRecommendations } from 'redux/selectors/search';
|
2022-02-26 06:18:10 +01:00
|
|
|
import { selectShowMatureContent, selectClientSetting } from 'redux/selectors/settings';
|
2022-03-17 01:23:16 +01:00
|
|
|
import { selectHasOdyseeMembership, selectUserVerifiedEmail } from 'redux/selectors/user';
|
2021-08-09 07:50:11 +02:00
|
|
|
|
2021-08-06 04:41:37 +02:00
|
|
|
import SettingContent from './view';
|
|
|
|
|
|
|
|
const select = (state) => ({
|
|
|
|
isAuthenticated: selectUserVerifiedEmail(state),
|
2021-11-23 05:29:04 +01:00
|
|
|
floatingPlayer: selectClientSetting(state, SETTINGS.FLOATING_PLAYER),
|
|
|
|
autoplayMedia: selectClientSetting(state, SETTINGS.AUTOPLAY_MEDIA),
|
|
|
|
autoplayNext: selectClientSetting(state, SETTINGS.AUTOPLAY_NEXT),
|
|
|
|
hideReposts: selectClientSetting(state, SETTINGS.HIDE_REPOSTS),
|
2022-01-05 22:20:43 +01:00
|
|
|
hideScheduledLivestreams: selectClientSetting(state, SETTINGS.HIDE_SCHEDULED_LIVESTREAMS),
|
2022-03-17 01:23:16 +01:00
|
|
|
hideFyp: selectClientSetting(state, SETTINGS.HIDE_FYP),
|
2021-08-06 04:41:37 +02:00
|
|
|
showNsfw: selectShowMatureContent(state),
|
2021-08-06 09:56:48 +02:00
|
|
|
myChannelUrls: selectMyChannelUrls(state),
|
2021-11-23 05:29:04 +01:00
|
|
|
instantPurchaseEnabled: selectClientSetting(state, SETTINGS.INSTANT_PURCHASE_ENABLED),
|
|
|
|
instantPurchaseMax: selectClientSetting(state, SETTINGS.INSTANT_PURCHASE_MAX),
|
|
|
|
enablePublishPreview: selectClientSetting(state, SETTINGS.ENABLE_PUBLISH_PREVIEW),
|
2022-03-17 01:23:16 +01:00
|
|
|
hasMembership: selectHasOdyseeMembership(state),
|
|
|
|
personalRecommendations: selectPersonalRecommendations(state),
|
2021-08-06 04:41:37 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
const perform = (dispatch) => ({
|
|
|
|
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
|
|
|
clearPlayingUri: () => dispatch(doSetPlayingUri({ uri: null })),
|
|
|
|
openModal: (id, params) => dispatch(doOpenModal(id, params)),
|
2022-03-17 01:23:16 +01:00
|
|
|
doFetchPersonalRecommendations: () => dispatch(doFetchPersonalRecommendations()),
|
2021-08-06 04:41:37 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(select, perform)(SettingContent);
|