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

View file

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