Add missing FileGet call

This commit is contained in:
Rafael 2022-04-20 10:12:32 -03:00 committed by Thomas Zarebczan
parent 0dccabe692
commit cbb6e2afe4
2 changed files with 11 additions and 0 deletions

View file

@ -6,6 +6,7 @@ import {
makeSelectTagInClaimOrChannelForUri, makeSelectTagInClaimOrChannelForUri,
selectIsStreamPlaceholderForUri, selectIsStreamPlaceholderForUri,
selectClaimForUri, selectClaimForUri,
selectClaimWasPurchasedForUri,
} from 'redux/selectors/claims'; } from 'redux/selectors/claims';
import { makeSelectFileInfoForUri } from 'redux/selectors/file_info'; import { makeSelectFileInfoForUri } from 'redux/selectors/file_info';
import { makeSelectCollectionForId } from 'redux/selectors/collections'; import { makeSelectCollectionForId } from 'redux/selectors/collections';
@ -18,6 +19,7 @@ import { selectCommentsListTitleForUri, selectSettingsByChannelId } from 'redux/
import { DISABLE_COMMENTS_TAG } from 'constants/tags'; import { DISABLE_COMMENTS_TAG } from 'constants/tags';
import { doToggleAppDrawer } from 'redux/actions/app'; import { doToggleAppDrawer } from 'redux/actions/app';
import { getChannelIdFromClaim } from 'util/claim'; import { getChannelIdFromClaim } from 'util/claim';
import { doFileGet } from 'redux/actions/file';
import FilePage from './view'; import FilePage from './view';
@ -46,6 +48,7 @@ const select = (state, props) => {
position: selectContentPositionForUri(state, uri), position: selectContentPositionForUri(state, uri),
audioVideoDuration: claim?.value?.video?.duration || claim?.value?.audio?.duration, audioVideoDuration: claim?.value?.video?.duration || claim?.value?.audio?.duration,
commentsListTitle: selectCommentsListTitleForUri(state, uri), commentsListTitle: selectCommentsListTitleForUri(state, uri),
claimWasPurchased: selectClaimWasPurchasedForUri(state, uri),
}; };
}; };
@ -55,6 +58,7 @@ const perform = {
doSetPrimaryUri, doSetPrimaryUri,
clearPosition, clearPosition,
doToggleAppDrawer, doToggleAppDrawer,
doFileGet,
}; };
export default withRouter(connect(select, perform)(FilePage)); export default withRouter(connect(select, perform)(FilePage));

View file

@ -44,12 +44,14 @@ type Props = {
commentsListTitle: string, commentsListTitle: string,
settingsByChannelId: { [channelId: string]: PerChannelSettings }, settingsByChannelId: { [channelId: string]: PerChannelSettings },
isPlaying?: boolean, isPlaying?: boolean,
claimWasPurchased: boolean,
doFetchCostInfoForUri: (uri: string) => void, doFetchCostInfoForUri: (uri: string) => void,
doSetContentHistoryItem: (uri: string) => void, doSetContentHistoryItem: (uri: string) => void,
doSetPrimaryUri: (uri: ?string) => void, doSetPrimaryUri: (uri: ?string) => void,
clearPosition: (uri: string) => void, clearPosition: (uri: string) => void,
doClearPlayingUri: () => void, doClearPlayingUri: () => void,
doToggleAppDrawer: () => void, doToggleAppDrawer: () => void,
doFileGet: (uri: string) => void,
}; };
export default function FilePage(props: Props) { export default function FilePage(props: Props) {
@ -73,11 +75,13 @@ export default function FilePage(props: Props) {
audioVideoDuration, audioVideoDuration,
commentsListTitle, commentsListTitle,
settingsByChannelId, settingsByChannelId,
claimWasPurchased,
doFetchCostInfoForUri, doFetchCostInfoForUri,
doSetContentHistoryItem, doSetContentHistoryItem,
doSetPrimaryUri, doSetPrimaryUri,
clearPosition, clearPosition,
doToggleAppDrawer, doToggleAppDrawer,
doFileGet,
} = props; } = props;
const isMobile = useIsMobile(); const isMobile = useIsMobile();
@ -123,6 +127,7 @@ export default function FilePage(props: Props) {
doFetchCostInfoForUri(uri); doFetchCostInfoForUri(uri);
doSetContentHistoryItem(uri); doSetContentHistoryItem(uri);
doSetPrimaryUri(uri); doSetPrimaryUri(uri);
if (claimWasPurchased && !hasFileInfo) doFileGet(uri);
return () => doSetPrimaryUri(null); return () => doSetPrimaryUri(null);
}, [ }, [
@ -135,6 +140,8 @@ export default function FilePage(props: Props) {
doFetchCostInfoForUri, doFetchCostInfoForUri,
doSetContentHistoryItem, doSetContentHistoryItem,
doSetPrimaryUri, doSetPrimaryUri,
doFileGet,
claimWasPurchased,
]); ]);
function renderFilePageLayout() { function renderFilePageLayout() {