802b5d5a18
- Only add for unauthenticated users for now. We can change that to look at premium later without having to touch `app/view.jsx`. - Only show the ad after knowing the ad is filled; this prevents the invisible container from blocking stuff while waiting, or even worse, when not filled.
62 lines
3 KiB
JavaScript
62 lines
3 KiB
JavaScript
import { hot } from 'react-hot-loader/root';
|
|
import { connect } from 'react-redux';
|
|
import { selectGetSyncErrorMessage, selectSyncFatalError, selectSyncIsLocked } from 'redux/selectors/sync';
|
|
import { doUserSetReferrer } from 'redux/actions/user';
|
|
import { selectOdyseeMembershipIsPremiumPlus, selectUser, selectUserLocale, selectUserVerifiedEmail } from 'redux/selectors/user';
|
|
import { selectUnclaimedRewards } from 'redux/selectors/rewards';
|
|
import { doFetchChannelListMine, doFetchCollectionListMine, doResolveUris } from 'redux/actions/claims';
|
|
import { selectMyChannelClaimIds } from 'redux/selectors/claims';
|
|
import { selectSubscriptions } from 'redux/selectors/subscriptions';
|
|
import { selectLanguage, selectLoadedLanguages, selectThemePath } from 'redux/selectors/settings';
|
|
import {
|
|
selectIsUpgradeAvailable,
|
|
selectAutoUpdateDownloaded,
|
|
selectModal,
|
|
selectActiveChannelClaim,
|
|
selectIsReloadRequired,
|
|
} from 'redux/selectors/app';
|
|
import { selectUploadCount } from 'redux/selectors/publish';
|
|
import { doSetLanguage } from 'redux/actions/settings';
|
|
import { doSyncLoop } from 'redux/actions/sync';
|
|
import { doDownloadUpgradeRequested, doSignIn, doSetActiveChannel, doSetIncognito } from 'redux/actions/app';
|
|
import { doFetchModBlockedList, doFetchCommentModAmIList } from 'redux/actions/comments';
|
|
import App from './view';
|
|
|
|
const select = (state) => ({
|
|
user: selectUser(state),
|
|
locale: selectUserLocale(state),
|
|
theme: selectThemePath(state),
|
|
language: selectLanguage(state),
|
|
languages: selectLoadedLanguages(state),
|
|
autoUpdateDownloaded: selectAutoUpdateDownloaded(state),
|
|
isUpgradeAvailable: selectIsUpgradeAvailable(state),
|
|
isReloadRequired: selectIsReloadRequired(state),
|
|
syncError: selectGetSyncErrorMessage(state),
|
|
syncIsLocked: selectSyncIsLocked(state),
|
|
uploadCount: selectUploadCount(state),
|
|
rewards: selectUnclaimedRewards(state),
|
|
isAuthenticated: selectUserVerifiedEmail(state),
|
|
currentModal: selectModal(state),
|
|
syncFatalError: selectSyncFatalError(state),
|
|
activeChannelClaim: selectActiveChannelClaim(state),
|
|
myChannelClaimIds: selectMyChannelClaimIds(state),
|
|
subscriptions: selectSubscriptions(state),
|
|
hasPremiumPlus: selectOdyseeMembershipIsPremiumPlus(state),
|
|
});
|
|
|
|
const perform = (dispatch) => ({
|
|
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
|
fetchCollectionListMine: () => dispatch(doFetchCollectionListMine()),
|
|
setLanguage: (language) => dispatch(doSetLanguage(language)),
|
|
signIn: () => dispatch(doSignIn()),
|
|
requestDownloadUpgrade: () => dispatch(doDownloadUpgradeRequested()),
|
|
syncLoop: (noInterval) => dispatch(doSyncLoop(noInterval)),
|
|
setReferrer: (referrer, doClaim) => dispatch(doUserSetReferrer(referrer, doClaim)),
|
|
setActiveChannelIfNotSet: () => dispatch(doSetActiveChannel()),
|
|
setIncognito: () => dispatch(doSetIncognito()),
|
|
fetchModBlockedList: () => dispatch(doFetchModBlockedList()),
|
|
resolveUris: (uris) => dispatch(doResolveUris(uris)),
|
|
fetchModAmIList: () => dispatch(doFetchCommentModAmIList()),
|
|
});
|
|
|
|
export default hot(connect(select, perform)(App));
|