commit
b67a2c692d
8 changed files with 16 additions and 10 deletions
|
@ -125,7 +125,7 @@
|
||||||
"jsmediatags": "^3.8.1",
|
"jsmediatags": "^3.8.1",
|
||||||
"json-loader": "^0.5.4",
|
"json-loader": "^0.5.4",
|
||||||
"lbry-format": "https://github.com/lbryio/lbry-format.git",
|
"lbry-format": "https://github.com/lbryio/lbry-format.git",
|
||||||
"lbry-redux": "lbryio/lbry-redux#027c517ec653f328eeed2cf509b1062b0f787f22",
|
"lbry-redux": "lbryio/lbry-redux#1af092ce2cb507d9a41711b864874c0bd76935ae",
|
||||||
"lbryinc": "lbryio/lbryinc#1ce266b3c52654190b955e9c869b8e302aa5c585",
|
"lbryinc": "lbryio/lbryinc#1ce266b3c52654190b955e9c869b8e302aa5c585",
|
||||||
"lint-staged": "^7.0.2",
|
"lint-staged": "^7.0.2",
|
||||||
"localforage": "^1.7.1",
|
"localforage": "^1.7.1",
|
||||||
|
|
|
@ -7,6 +7,7 @@ import {
|
||||||
makeSelectMetadataItemForUri,
|
makeSelectMetadataItemForUri,
|
||||||
doUpdateChannel,
|
doUpdateChannel,
|
||||||
makeSelectAmountForUri,
|
makeSelectAmountForUri,
|
||||||
|
makeSelectClaimForUri,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
import ChannelPage from './view';
|
import ChannelPage from './view';
|
||||||
|
|
||||||
|
@ -22,6 +23,7 @@ const select = (state, props) => ({
|
||||||
locations: makeSelectMetadataItemForUri(props.uri, 'locations')(state),
|
locations: makeSelectMetadataItemForUri(props.uri, 'locations')(state),
|
||||||
languages: makeSelectMetadataItemForUri(props.uri, 'languages')(state),
|
languages: makeSelectMetadataItemForUri(props.uri, 'languages')(state),
|
||||||
amount: makeSelectAmountForUri(props.uri)(state),
|
amount: makeSelectAmountForUri(props.uri)(state),
|
||||||
|
claim: makeSelectClaimForUri(props.uri)(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
// @flow
|
// @flow
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { parseURI } from 'lbry-redux';
|
|
||||||
import { Form, FormField } from 'component/common/form';
|
import { Form, FormField } from 'component/common/form';
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
import SelectAsset from 'component/selectAsset';
|
import SelectAsset from 'component/selectAsset';
|
||||||
import TagSelect from 'component/tagsSelect';
|
import TagSelect from 'component/tagsSelect';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
uri: string,
|
claim: ChannelClaim,
|
||||||
title: ?string,
|
title: ?string,
|
||||||
amount: string,
|
amount: string,
|
||||||
cover: ?string,
|
cover: ?string,
|
||||||
|
@ -28,7 +27,7 @@ type Props = {
|
||||||
|
|
||||||
function ChannelForm(props: Props) {
|
function ChannelForm(props: Props) {
|
||||||
const {
|
const {
|
||||||
uri,
|
claim,
|
||||||
title,
|
title,
|
||||||
cover,
|
cover,
|
||||||
description,
|
description,
|
||||||
|
@ -44,7 +43,7 @@ function ChannelForm(props: Props) {
|
||||||
updateThumb,
|
updateThumb,
|
||||||
updateCover,
|
updateCover,
|
||||||
} = props;
|
} = props;
|
||||||
const { claimId } = parseURI(uri);
|
const { claim_id: claimId } = claim;
|
||||||
|
|
||||||
// fill this in with sdk data
|
// fill this in with sdk data
|
||||||
const channelParams = {
|
const channelParams = {
|
||||||
|
|
|
@ -8,6 +8,7 @@ import {
|
||||||
makeSelectUriIsStreamable,
|
makeSelectUriIsStreamable,
|
||||||
makeSelectTitleForUri,
|
makeSelectTitleForUri,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
|
import { doClaimEligiblePurchaseRewards } from 'lbryinc';
|
||||||
import { makeSelectIsPlaying, makeSelectShouldObscurePreview, selectPlayingUri } from 'redux/selectors/content';
|
import { makeSelectIsPlaying, makeSelectShouldObscurePreview, selectPlayingUri } from 'redux/selectors/content';
|
||||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||||
import { doSetPlayingUri } from 'redux/actions/content';
|
import { doSetPlayingUri } from 'redux/actions/content';
|
||||||
|
@ -34,6 +35,7 @@ const select = (state, props) => {
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
clearPlayingUri: () => dispatch(doSetPlayingUri(null)),
|
clearPlayingUri: () => dispatch(doSetPlayingUri(null)),
|
||||||
triggerAnalyticsView: (uri, timeToStart) => dispatch(doAnalyticsView(uri, timeToStart)),
|
triggerAnalyticsView: (uri, timeToStart) => dispatch(doAnalyticsView(uri, timeToStart)),
|
||||||
|
claimRewards: () => dispatch(doClaimEligiblePurchaseRewards()),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default withRouter(
|
export default withRouter(
|
||||||
|
|
|
@ -29,6 +29,7 @@ type Props = {
|
||||||
floatingPlayerEnabled: boolean,
|
floatingPlayerEnabled: boolean,
|
||||||
clearPlayingUri: () => void,
|
clearPlayingUri: () => void,
|
||||||
triggerAnalyticsView: (string, number) => void,
|
triggerAnalyticsView: (string, number) => void,
|
||||||
|
claimRewards: () => void,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function FileViewer(props: Props) {
|
export default function FileViewer(props: Props) {
|
||||||
|
@ -43,6 +44,7 @@ export default function FileViewer(props: Props) {
|
||||||
clearPlayingUri,
|
clearPlayingUri,
|
||||||
floatingPlayerEnabled,
|
floatingPlayerEnabled,
|
||||||
triggerAnalyticsView,
|
triggerAnalyticsView,
|
||||||
|
claimRewards,
|
||||||
} = props;
|
} = props;
|
||||||
const [playTime, setPlayTime] = useState();
|
const [playTime, setPlayTime] = useState();
|
||||||
const [fileViewerRect, setFileViewerRect] = usePersistedState('inline-file-viewer:rect');
|
const [fileViewerRect, setFileViewerRect] = usePersistedState('inline-file-viewer:rect');
|
||||||
|
@ -73,9 +75,10 @@ export default function FileViewer(props: Props) {
|
||||||
if (playTime && isReadyToPlay && wasntReadyButNowItIs) {
|
if (playTime && isReadyToPlay && wasntReadyButNowItIs) {
|
||||||
const timeToStart = Date.now() - playTime;
|
const timeToStart = Date.now() - playTime;
|
||||||
triggerAnalyticsView(uri, timeToStart);
|
triggerAnalyticsView(uri, timeToStart);
|
||||||
|
claimRewards();
|
||||||
setPlayTime(null);
|
setPlayTime(null);
|
||||||
}
|
}
|
||||||
}, [setPlayTime, triggerAnalyticsView, isReadyToPlay, wasntReadyButNowItIs, playTime, uri]);
|
}, [setPlayTime, triggerAnalyticsView, isReadyToPlay, wasntReadyButNowItIs, playTime, uri, claimRewards]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
function handleResize() {
|
function handleResize() {
|
||||||
|
|
|
@ -48,7 +48,7 @@ function ModalRemoveFile(props: Props) {
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<div className="card__actions">
|
<div className="card__actions">
|
||||||
<Button type="submit" button="primary" label={__('OK')} disabled={!deleteChecked && !abandonChecked} />
|
<Button type="submit" button="primary" label={__('OK')} />
|
||||||
<Button button="link" label={__('Cancel')} onClick={closeModal} />
|
<Button button="link" label={__('Cancel')} onClick={closeModal} />
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
|
|
|
@ -53,7 +53,7 @@ export function doDeleteFileAndMaybeGoBack(uri, deleteFromComputer, abandonClaim
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
const state = getState();
|
const state = getState();
|
||||||
const playingUri = selectPlayingUri(state);
|
const playingUri = selectPlayingUri(state);
|
||||||
const { outpoint } = makeSelectFileInfoForUri(uri)(state);
|
const { outpoint } = makeSelectFileInfoForUri(uri)(state) || '';
|
||||||
const actions = [];
|
const actions = [];
|
||||||
actions.push(doHideModal());
|
actions.push(doHideModal());
|
||||||
actions.push(doDeleteFile(outpoint, deleteFromComputer, abandonClaim));
|
actions.push(doDeleteFile(outpoint, deleteFromComputer, abandonClaim));
|
||||||
|
|
|
@ -6762,9 +6762,9 @@ lazy-val@^1.0.3, lazy-val@^1.0.4:
|
||||||
yargs "^13.2.2"
|
yargs "^13.2.2"
|
||||||
zstd-codec "^0.1.1"
|
zstd-codec "^0.1.1"
|
||||||
|
|
||||||
lbry-redux@lbryio/lbry-redux#027c517ec653f328eeed2cf509b1062b0f787f22:
|
lbry-redux@lbryio/lbry-redux#1af092ce2cb507d9a41711b864874c0bd76935ae:
|
||||||
version "0.0.1"
|
version "0.0.1"
|
||||||
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/027c517ec653f328eeed2cf509b1062b0f787f22"
|
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/1af092ce2cb507d9a41711b864874c0bd76935ae"
|
||||||
dependencies:
|
dependencies:
|
||||||
mime "^2.4.4"
|
mime "^2.4.4"
|
||||||
proxy-polyfill "0.1.6"
|
proxy-polyfill "0.1.6"
|
||||||
|
|
Loading…
Add table
Reference in a new issue