diff --git a/package.json b/package.json
index d0e4af11d..211f98dc9 100644
--- a/package.json
+++ b/package.json
@@ -135,7 +135,7 @@
"imagesloaded": "^4.1.4",
"json-loader": "^0.5.4",
"lbry-format": "https://github.com/lbryio/lbry-format.git",
- "lbry-redux": "lbryio/lbry-redux#f8ac5359d9d05fba2c3a536003a9d4c64b86c9f0",
+ "lbry-redux": "lbryio/lbry-redux#e9d03635883fbe87f1835fca0bf28b402cca6696",
"lbryinc": "lbryio/lbryinc#72eee35f5181940eb4a468a27ddb2a2a4e362fb0",
"lint-staged": "^7.0.2",
"localforage": "^1.7.1",
diff --git a/static/app-strings.json b/static/app-strings.json
index 826936baf..a3cc41820 100644
--- a/static/app-strings.json
+++ b/static/app-strings.json
@@ -1236,5 +1236,11 @@
"Loading your channels...": "Loading your channels...",
"Try Out the App!": "Try Out the App!",
"Download the app to track files you've viewed and downloaded.": "Download the app to track files you've viewed and downloaded.",
- "Create a New Channel": "Create a New Channel"
-}
+ "Create a New Channel": "Create a New Channel",
+ "Thumbnail source": "Thumbnail source",
+ "Cover source": "Cover source",
+ "Your changes will be live in a few minutes": "Your changes will be live in a few minutes",
+ "Submitting": "Submitting",
+ "Thumbnail Recommended ratio is 1:1": "Thumbnail Recommended ratio is 1:1",
+ "Cover Recommended ratio is 6.25:1": "Cover Recommended ratio is 6.25:1"
+}
\ No newline at end of file
diff --git a/ui/component/channelAbout/view.jsx b/ui/component/channelAbout/view.jsx
index c18b651f3..98acce7cb 100644
--- a/ui/component/channelAbout/view.jsx
+++ b/ui/component/channelAbout/view.jsx
@@ -31,6 +31,7 @@ function ChannelAbout(props: Props) {
+ {__('Description')}
{description && (
diff --git a/ui/component/channelEdit/index.js b/ui/component/channelEdit/index.js
index e40609668..224072731 100644
--- a/ui/component/channelEdit/index.js
+++ b/ui/component/channelEdit/index.js
@@ -8,6 +8,8 @@ import {
doUpdateChannel,
makeSelectAmountForUri,
makeSelectClaimForUri,
+ selectUpdateChannelError,
+ selectUpdatingChannel,
} from 'lbry-redux';
import ChannelPage from './view';
@@ -24,6 +26,8 @@ const select = (state, props) => ({
languages: makeSelectMetadataItemForUri(props.uri, 'languages')(state),
amount: makeSelectAmountForUri(props.uri)(state),
claim: makeSelectClaimForUri(props.uri)(state),
+ updateError: selectUpdateChannelError(state),
+ updatingChannel: selectUpdatingChannel(state),
});
const perform = dispatch => ({
diff --git a/ui/component/channelEdit/view.jsx b/ui/component/channelEdit/view.jsx
index 1311a1a3a..43b0b7ee0 100644
--- a/ui/component/channelEdit/view.jsx
+++ b/ui/component/channelEdit/view.jsx
@@ -3,10 +3,10 @@ import React, { useState } from 'react';
import { FormField } from 'component/common/form';
import Button from 'component/button';
import SelectAsset from 'component/selectAsset';
-import * as PAGES from 'constants/pages';
import { MINIMUM_PUBLISH_BID } from 'constants/claim';
import TagsSearch from 'component/tagsSearch';
import { FF_MAX_CHARS_IN_DESCRIPTION } from 'constants/form-field';
+import ErrorText from 'component/common/error-text';
type Props = {
claim: ChannelClaim,
@@ -22,10 +22,12 @@ type Props = {
tags: Array
,
locations: Array,
languages: Array,
- updateChannel: any => void,
+ updateChannel: any => Promise,
updateThumb: string => void,
updateCover: string => void,
- setEditing: boolean => void,
+ doneEditing: () => void,
+ updateError: string,
+ updatingChannel: boolean,
};
function ChannelForm(props: Props) {
@@ -41,10 +43,12 @@ function ChannelForm(props: Props) {
locations,
languages,
amount,
- setEditing,
+ doneEditing,
updateChannel,
updateThumb,
updateCover,
+ updateError,
+ updatingChannel,
} = props;
const { claim_id: claimId } = claim;
@@ -101,110 +105,123 @@ function ChannelForm(props: Props) {
};
const handleSubmit = () => {
- updateChannel(params);
- setEditing(false);
+ updateChannel(params).then(success => {
+ if (success) {
+ doneEditing();
+ }
+ });
};
// TODO clear and bail after submit
return (
-
- handleThumbnailChange(v)}
- currentValue={params.thumbnailUrl}
- assetName={'Thumbnail'}
- recommended={__('Recommended ratio is 1:1')}
- />
+
+
+ handleThumbnailChange(v)}
+ currentValue={params.thumbnailUrl}
+ assetName={'Thumbnail'}
+ recommended={__('Recommended ratio is 1:1')}
+ />
- handleCoverChange(v)}
- currentValue={params.coverUrl}
- assetName={'Cover'}
- recommended={__('Recommended ratio is 6.25:1')}
- />
+ handleCoverChange(v)}
+ currentValue={params.coverUrl}
+ assetName={'Cover'}
+ recommended={__('Recommended ratio is 6.25:1')}
+ />
- setParams({ ...params, title: e.target.value })}
- />
- handleBidChange(parseFloat(event.target.value))}
- placeholder={0.1}
- />
+ setParams({ ...params, title: e.target.value })}
+ />
+ handleBidChange(parseFloat(event.target.value))}
+ placeholder={0.1}
+ />
- setParams({ ...params, website: e.target.value })}
- />
+ setParams({ ...params, website: e.target.value })}
+ />
- setParams({ ...params, email: e.target.value })}
- />
+ setParams({ ...params, email: e.target.value })}
+ />
- setParams({ ...params, description: text })}
- textAreaMaxLength={FF_MAX_CHARS_IN_DESCRIPTION}
- />
+ setParams({ ...params, description: text })}
+ textAreaMaxLength={FF_MAX_CHARS_IN_DESCRIPTION}
+ />
- {
- const newTags = params.tags.slice().filter(tag => tag.name !== clickedTag.name);
- setParams({ ...params, tags: newTags });
- }}
- onSelect={newTags => {
- newTags.forEach(newTag => {
- if (!params.tags.map(savedTag => savedTag.name).includes(newTag.name)) {
- setParams({ ...params, tags: [...params.tags, newTag] });
- } else {
- // If it already exists and the user types it in, remove it
- setParams({ ...params, tags: params.tags.filter(tag => tag.name !== newTag.name) });
- }
- });
- }}
- />
-
-
-
-
-
- {__('After submitting, you will not see the changes immediately. Please check back in a few minutes.')}
-
-
+
{
+ const newTags = params.tags.slice().filter(tag => tag.name !== clickedTag.name);
+ setParams({ ...params, tags: newTags });
+ }}
+ onSelect={newTags => {
+ newTags.forEach(newTag => {
+ if (!params.tags.map(savedTag => savedTag.name).includes(newTag.name)) {
+ setParams({ ...params, tags: [...params.tags, newTag] });
+ } else {
+ // If it already exists and the user types it in, remove it
+ setParams({ ...params, tags: params.tags.filter(tag => tag.name !== newTag.name) });
+ }
+ });
+ }}
+ />
+
+
+
+
+ {updateError && updateError.length ? (
+ {updateError}
+ ) : (
+
+ {__('After submitting, you will not see the changes immediately. Please check back in a few minutes.')}
+
+ )}
+
+
);
}
diff --git a/ui/component/claimAbandonButton/view.jsx b/ui/component/claimAbandonButton/view.jsx
index 52d5c37a0..1730e13a0 100644
--- a/ui/component/claimAbandonButton/view.jsx
+++ b/ui/component/claimAbandonButton/view.jsx
@@ -8,14 +8,15 @@ type Props = {
doOpenModal: (string, {}) => void,
claim: StreamClaim,
abandonActionCallback: any => void,
+ iconSize: number,
};
export default function ClaimAbandonButton(props: Props) {
- const { doOpenModal, claim, abandonActionCallback } = props;
+ const { doOpenModal, claim, abandonActionCallback, iconSize } = props;
function abandonClaim() {
doOpenModal(MODALS.CONFIRM_CLAIM_REVOKE, { claim: claim, cb: abandonActionCallback });
}
- return ;
+ return ;
}
diff --git a/ui/component/claimPreviewTile/view.jsx b/ui/component/claimPreviewTile/view.jsx
index 816c2ff2e..b483f0452 100644
--- a/ui/component/claimPreviewTile/view.jsx
+++ b/ui/component/claimPreviewTile/view.jsx
@@ -61,7 +61,7 @@ function ClaimPreviewTile(props: Props) {
const isRepost = claim && claim.repost_channel_url;
const shouldFetch = claim === undefined;
const thumbnailUrl = useGetThumbnail(uri, claim, streamingUrl, getFile, placeholder) || thumbnail;
- const claimsInChannel = (claim && claim.meta.claims_in_channel) || 0;
+ const claimsInChannel = (claim && claim.meta && claim.meta.claims_in_channel) || 0;
const canonicalUrl = claim && claim.canonical_url;
const navigateUrl = formatLbryUrlForWeb(canonicalUrl || uri || '/');
diff --git a/ui/page/channel/index.js b/ui/page/channel/index.js
index 6a323c33e..e352bd1e9 100644
--- a/ui/page/channel/index.js
+++ b/ui/page/channel/index.js
@@ -7,6 +7,7 @@ import {
selectCurrentChannelPage,
makeSelectClaimForUri,
selectChannelIsBlocked,
+ makeSelectClaimIsPending,
} from 'lbry-redux';
import { selectBlackListedOutpoints, doFetchSubCount, makeSelectSubCountForUri } from 'lbryinc';
import { makeSelectIsSubscribed } from 'redux/selectors/subscriptions';
@@ -23,6 +24,7 @@ const select = (state, props) => ({
channelIsBlocked: selectChannelIsBlocked(props.uri)(state),
blackListedOutpoints: selectBlackListedOutpoints(state),
subCount: makeSelectSubCountForUri(props.uri)(state),
+ pending: makeSelectClaimIsPending(props.uri)(state),
});
const perform = dispatch => ({
diff --git a/ui/page/channel/view.jsx b/ui/page/channel/view.jsx
index 5110f967f..6b2968ef8 100644
--- a/ui/page/channel/view.jsx
+++ b/ui/page/channel/view.jsx
@@ -46,6 +46,7 @@ type Props = {
}>,
fetchSubCount: string => void,
subCount: number,
+ pending: boolean,
};
function ChannelPage(props: Props) {
@@ -64,6 +65,7 @@ function ChannelPage(props: Props) {
blackListedOutpoints,
fetchSubCount,
subCount,
+ pending,
} = props;
const { channelName } = parseURI(uri);
@@ -98,6 +100,12 @@ function ChannelPage(props: Props) {
history.push(`${url}${search}`);
}
+ function doneEditing() {
+ setEditing(false);
+ setThumbPreview(thumbnail);
+ setCoverPreview(cover);
+ }
+
useEffect(() => {
Lbryio.call('yt', 'get_youtuber', { channel_claim_id: claimId }).then(response => {
if (response.is_verified_youtuber) {
@@ -176,11 +184,27 @@ function ChannelPage(props: Props) {
{channelIsMine && !editing && (
+ <>
+ {pending ? (
+ {__('Your changes will be live in a few minutes')}
+ ) : (
+ setEditing(!editing)}
+ icon={ICONS.EDIT}
+ iconSize={18}
+ disabled={pending}
+ />
+ )}
+ >
+ )}
+ {channelIsMine && editing && (
setEditing(!editing)}
- icon={ICONS.EDIT}
+ title={__('Cancel')}
+ onClick={() => doneEditing()}
+ icon={ICONS.REMOVE}
iconSize={18}
/>
)}
@@ -203,7 +227,7 @@ function ChannelPage(props: Props) {
{editing ? (
setThumbPreview(v)}
updateCover={v => setCoverPreview(v)}
/>
diff --git a/ui/page/channels/index.js b/ui/page/channels/index.js
index 7ccae5a2c..b079f9b63 100644
--- a/ui/page/channels/index.js
+++ b/ui/page/channels/index.js
@@ -1,10 +1,16 @@
import { connect } from 'react-redux';
-import { selectMyChannelClaims, doFetchChannelListMine, selectFetchingMyChannels } from 'lbry-redux';
+import {
+ selectMyChannelClaims,
+ selectMyChannelUrls,
+ doFetchChannelListMine,
+ selectFetchingMyChannels,
+} from 'lbry-redux';
import { selectYoutubeChannels } from 'redux/selectors/user';
import { doOpenModal } from 'redux/actions/app';
import ChannelsPage from './view';
const select = state => ({
+ channelUrls: selectMyChannelUrls(state),
channels: selectMyChannelClaims(state),
fetchingChannels: selectFetchingMyChannels(state),
youtubeChannels: selectYoutubeChannels(state),
diff --git a/ui/page/channels/view.jsx b/ui/page/channels/view.jsx
index 12f9ec42b..b3286adc6 100644
--- a/ui/page/channels/view.jsx
+++ b/ui/page/channels/view.jsx
@@ -11,6 +11,7 @@ import Card from 'component/common/card';
type Props = {
channels: Array,
+ channelUrls: Array,
fetchChannelListMine: () => void,
fetchingChannels: boolean,
youtubeChannels: ?Array,
@@ -18,30 +19,19 @@ type Props = {
};
export default function ChannelsPage(props: Props) {
- const { channels, fetchChannelListMine, fetchingChannels, youtubeChannels, openModal } = props;
+ const { channels, channelUrls, fetchChannelListMine, fetchingChannels, youtubeChannels, openModal } = props;
const hasYoutubeChannels = youtubeChannels && Boolean(youtubeChannels.length);
const hasPendingChannels = channels && channels.some(channel => channel.confirmations < 0);
useEffect(() => {
fetchChannelListMine();
-
- let interval;
- if (hasPendingChannels) {
- interval = setInterval(() => {
- fetchChannelListMine();
- }, 5000);
- }
-
- return () => {
- clearInterval(interval);
- };
}, [fetchChannelListMine, hasPendingChannels]);
return (
{hasYoutubeChannels && }
- {channels && Boolean(channels.length) && (
+ {channelUrls && Boolean(channelUrls.length) && (
}
isBodyList
- body={
- channel.permanent_url)} />
- }
+ body={ }
/>
)}
- {!(channels && channels.length) && (
+ {!(channelUrls && channelUrls.length) && (
{!fetchingChannels ? (
diff --git a/ui/redux/actions/publish.js b/ui/redux/actions/publish.js
index 32158b5cc..cfe34c6e9 100644
--- a/ui/redux/actions/publish.js
+++ b/ui/redux/actions/publish.js
@@ -6,7 +6,7 @@ import {
batchActions,
selectMyClaims,
doPublish,
- doCheckPendingPublishes,
+ doCheckPendingClaims,
doCheckReflectingFiles,
ACTIONS as LBRY_REDUX_ACTIONS,
} from 'lbry-redux';
@@ -101,5 +101,5 @@ export const doCheckPendingPublishesApp = () => (dispatch: Dispatch, getState: G
};
}
};
- return dispatch(doCheckPendingPublishes(onConfirmed));
+ return dispatch(doCheckPendingClaims(onConfirmed));
};
diff --git a/yarn.lock b/yarn.lock
index 7ca712ad3..f7ef91a53 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -6347,9 +6347,9 @@ lazy-val@^1.0.4:
yargs "^13.2.2"
zstd-codec "^0.1.1"
-lbry-redux@lbryio/lbry-redux#f8ac5359d9d05fba2c3a536003a9d4c64b86c9f0:
+lbry-redux@lbryio/lbry-redux#e9d03635883fbe87f1835fca0bf28b402cca6696:
version "0.0.1"
- resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/f8ac5359d9d05fba2c3a536003a9d4c64b86c9f0"
+ resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/e9d03635883fbe87f1835fca0bf28b402cca6696"
dependencies:
proxy-polyfill "0.1.6"
reselect "^3.0.0"