mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-08-23 17:47:24 +00:00
fix bugs and review changes
This commit is contained in:
parent
8ce05ebf76
commit
ac62156229
9 changed files with 25 additions and 24 deletions
|
@ -22,12 +22,7 @@ function AbandonedChannelPreview(props: Props) {
|
||||||
const { channelName } = parseURI(uri);
|
const { channelName } = parseURI(uri);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li
|
<li className={classnames('claim-preview__wrapper', 'claim-preview__wrapper--notice')}>
|
||||||
className={classnames('claim-preview__wrapper', {
|
|
||||||
'claim-preview__wrapper--channel': type !== 'inline',
|
|
||||||
'claim-preview__wrapper--inline': type === 'inline',
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
<div className={classnames('claim-preview', { 'claim-preview--large': type === 'large' })}>
|
<div className={classnames('claim-preview', { 'claim-preview--large': type === 'large' })}>
|
||||||
<ChannelThumbnail uri={uri} />
|
<ChannelThumbnail uri={uri} />
|
||||||
<div className="claim-preview__text">
|
<div className="claim-preview__text">
|
||||||
|
@ -35,11 +30,11 @@ function AbandonedChannelPreview(props: Props) {
|
||||||
<div className="claim-preview-info">
|
<div className="claim-preview-info">
|
||||||
<div className="claim-preview__title">{channelName}</div>
|
<div className="claim-preview__title">{channelName}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="media__subtitle">{`This channel may have been abandoned.`}</div>
|
<div className="media__subtitle">{__(`This channel may have been unpublished.`)}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="claim-preview__actions">
|
<div className="claim-preview__actions">
|
||||||
|
{/* SubscribeButton uses resolved permanentUri; modifying it didn't seem worth it. */}
|
||||||
<Button
|
<Button
|
||||||
// ref={buttonRef}
|
|
||||||
iconColor="red"
|
iconColor="red"
|
||||||
icon={ICONS.UNSUBSCRIBE}
|
icon={ICONS.UNSUBSCRIBE}
|
||||||
button={'alt'}
|
button={'alt'}
|
||||||
|
@ -47,7 +42,7 @@ function AbandonedChannelPreview(props: Props) {
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
doChannelUnsubscribe({
|
doChannelUnsubscribe({
|
||||||
channelName,
|
channelName: `@${channelName}`,
|
||||||
uri,
|
uri,
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -29,7 +29,7 @@ type Props = {
|
||||||
persistedStorageKey?: string,
|
persistedStorageKey?: string,
|
||||||
showHiddenByUser: boolean,
|
showHiddenByUser: boolean,
|
||||||
headerLabel?: string | Node,
|
headerLabel?: string | Node,
|
||||||
nullPreviewBehavior?: string,
|
showUnresolvedClaims?: boolean,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function ClaimList(props: Props) {
|
export default function ClaimList(props: Props) {
|
||||||
|
@ -48,7 +48,7 @@ export default function ClaimList(props: Props) {
|
||||||
id,
|
id,
|
||||||
showHiddenByUser,
|
showHiddenByUser,
|
||||||
headerLabel,
|
headerLabel,
|
||||||
nullPreviewBehavior,
|
showUnresolvedClaims,
|
||||||
} = props;
|
} = props;
|
||||||
const [scrollBottomCbMap, setScrollBottomCbMap] = useState({});
|
const [scrollBottomCbMap, setScrollBottomCbMap] = useState({});
|
||||||
const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey, SORT_NEW);
|
const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey, SORT_NEW);
|
||||||
|
@ -132,7 +132,7 @@ export default function ClaimList(props: Props) {
|
||||||
key={uri}
|
key={uri}
|
||||||
uri={uri}
|
uri={uri}
|
||||||
type={type}
|
type={type}
|
||||||
nullPreview={nullPreviewBehavior}
|
showUnresolvedClaim={showUnresolvedClaims}
|
||||||
properties={type !== 'small' ? undefined : false}
|
properties={type !== 'small' ? undefined : false}
|
||||||
showUserBlocked={showHiddenByUser}
|
showUserBlocked={showHiddenByUser}
|
||||||
customShouldHide={(claim: StreamClaim) => {
|
customShouldHide={(claim: StreamClaim) => {
|
||||||
|
|
|
@ -55,7 +55,7 @@ type Props = {
|
||||||
streamingUrl: ?string,
|
streamingUrl: ?string,
|
||||||
getFile: string => void,
|
getFile: string => void,
|
||||||
customShouldHide?: Claim => boolean,
|
customShouldHide?: Claim => boolean,
|
||||||
nullPreview?: string,
|
showUnresolvedClaim?: boolean,
|
||||||
};
|
};
|
||||||
|
|
||||||
const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||||
|
@ -86,12 +86,12 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||||
getFile,
|
getFile,
|
||||||
streamingUrl,
|
streamingUrl,
|
||||||
customShouldHide,
|
customShouldHide,
|
||||||
nullPreview,
|
showUnresolvedClaim,
|
||||||
} = props;
|
} = props;
|
||||||
const shouldFetch =
|
const shouldFetch =
|
||||||
claim === undefined || (claim !== null && claim.value_type === 'channel' && isEmpty(claim.meta) && !pending);
|
claim === undefined || (claim !== null && claim.value_type === 'channel' && isEmpty(claim.meta) && !pending);
|
||||||
const abandoned = !isResolvingUri && !claim;
|
const abandoned = !isResolvingUri && !claim;
|
||||||
const showPublishLink = abandoned && placeholder === 'publish';
|
const showPublishLink = abandoned && !showUnresolvedClaim && placeholder === 'publish';
|
||||||
const hideActions = type === 'small' || type === 'tooltip';
|
const hideActions = type === 'small' || type === 'tooltip';
|
||||||
const canonicalUrl = claim && claim.canonical_url;
|
const canonicalUrl = claim && claim.canonical_url;
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||||
let shouldHide =
|
let shouldHide =
|
||||||
placeholder !== 'loading' &&
|
placeholder !== 'loading' &&
|
||||||
!showUserBlocked &&
|
!showUserBlocked &&
|
||||||
((abandoned && !nullPreview === 'abandonedChannel' && !showPublishLink) || (!claimIsMine && obscureNsfw && nsfw));
|
((abandoned && !showUnresolvedClaim && !showPublishLink) || (!claimIsMine && obscureNsfw && nsfw));
|
||||||
|
|
||||||
// This will be replaced once blocking is done at the wallet server level
|
// This will be replaced once blocking is done at the wallet server level
|
||||||
if (claim && !claimIsMine && !shouldHide && blackListedOutpoints) {
|
if (claim && !claimIsMine && !shouldHide && blackListedOutpoints) {
|
||||||
|
@ -186,7 +186,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (placeholder === 'loading' || (isResolvingUri && !claim)) {
|
if (placeholder === 'loading' || claim === undefined || (isResolvingUri && !claim)) {
|
||||||
return (
|
return (
|
||||||
<li
|
<li
|
||||||
disabled
|
disabled
|
||||||
|
@ -206,7 +206,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nullPreview === 'abandonedChannel' && !isResolvingUri && !claim) {
|
if (!shouldFetch && showUnresolvedClaim && !isResolvingUri && claim === null) {
|
||||||
return <AbandonedChannelPreview uri={uri} type />;
|
return <AbandonedChannelPreview uri={uri} type />;
|
||||||
}
|
}
|
||||||
if (placeholder === 'publish' && !claim && uri.startsWith('lbry://@')) {
|
if (placeholder === 'publish' && !claim && uri.startsWith('lbry://@')) {
|
||||||
|
@ -264,7 +264,6 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||||
</NavLink>
|
</NavLink>
|
||||||
{!isChannel && <FileProperties uri={uri} />}
|
{!isChannel && <FileProperties uri={uri} />}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ClaimPreviewSubtitle uri={uri} type={type} />
|
<ClaimPreviewSubtitle uri={uri} type={type} />
|
||||||
</div>
|
</div>
|
||||||
<div className="claim-preview__actions">
|
<div className="claim-preview__actions">
|
||||||
|
|
|
@ -51,7 +51,7 @@ export default class SplashScreen extends React.PureComponent<Props, State> {
|
||||||
message: __('Connecting'),
|
message: __('Connecting'),
|
||||||
launchedModal: false,
|
launchedModal: false,
|
||||||
error: false,
|
error: false,
|
||||||
launchWithIncompatibleDaemon: false,
|
launchWithIncompatibleDaemon: !process.env.NODE_ENV === 'production',
|
||||||
isRunning: false,
|
isRunning: false,
|
||||||
waitingForWallet: 0,
|
waitingForWallet: 0,
|
||||||
};
|
};
|
||||||
|
|
|
@ -38,7 +38,7 @@ function ChannelsFollowingManagePage(props: Props) {
|
||||||
return (
|
return (
|
||||||
<Page>
|
<Page>
|
||||||
<ClaimList
|
<ClaimList
|
||||||
nullPreviewBehavior={'abandonedChannel'}
|
showUnresolvedClaims
|
||||||
header={viewingSuggestedSubs ? __('Discover New Channels') : __('Channels You Follow')}
|
header={viewingSuggestedSubs ? __('Discover New Channels') : __('Channels You Follow')}
|
||||||
headerAltControls={
|
headerAltControls={
|
||||||
<Button
|
<Button
|
||||||
|
|
|
@ -262,7 +262,7 @@ export function doCheckDaemonVersion() {
|
||||||
Lbry.version().then(({ lbrynet_version: lbrynetVersion }) => {
|
Lbry.version().then(({ lbrynet_version: lbrynetVersion }) => {
|
||||||
// Avoid the incompatible daemon modal if running in dev mode
|
// Avoid the incompatible daemon modal if running in dev mode
|
||||||
// Lets you run a different daemon than the one specified in package.json
|
// Lets you run a different daemon than the one specified in package.json
|
||||||
if (config.lbrynetDaemonVersion === lbrynetVersion) {
|
if (config.lbrynetDaemonVersion === lbrynetVersion || process.env.NODE_ENV !== 'production') {
|
||||||
return dispatch({
|
return dispatch({
|
||||||
type: ACTIONS.DAEMON_VERSION_MATCH,
|
type: ACTIONS.DAEMON_VERSION_MATCH,
|
||||||
});
|
});
|
||||||
|
@ -271,8 +271,9 @@ export function doCheckDaemonVersion() {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ACTIONS.DAEMON_VERSION_MISMATCH,
|
type: ACTIONS.DAEMON_VERSION_MISMATCH,
|
||||||
});
|
});
|
||||||
|
if (process.env.NODE_ENV === 'production') {
|
||||||
return dispatch(doOpenModal(MODALS.INCOMPATIBLE_DAEMON));
|
return dispatch(doOpenModal(MODALS.INCOMPATIBLE_DAEMON));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
// @endif
|
// @endif
|
||||||
// @if TARGET='web'
|
// @if TARGET='web'
|
||||||
|
|
|
@ -69,6 +69,10 @@
|
||||||
background-color: var(--color-card-background-highlighted);
|
background-color: var(--color-card-background-highlighted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.claim-preview__wrapper--notice {
|
||||||
|
background-color: var(--color-notice);
|
||||||
|
}
|
||||||
|
|
||||||
.claim-preview__wrapper--inline {
|
.claim-preview__wrapper--inline {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
--color-modal-background: var(--color-header-background);
|
--color-modal-background: var(--color-header-background);
|
||||||
--color-comment-menu: #6a6a6a;
|
--color-comment-menu: #6a6a6a;
|
||||||
--color-comment-menu-hovering: #e0e0e0;
|
--color-comment-menu-hovering: #e0e0e0;
|
||||||
|
--color-notice: #58563b;
|
||||||
|
|
||||||
// Text
|
// Text
|
||||||
--color-text: #eeeeee;
|
--color-text: #eeeeee;
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
--color-error: #fcafca;
|
--color-error: #fcafca;
|
||||||
--color-comment-menu: #e0e0e0;
|
--color-comment-menu: #e0e0e0;
|
||||||
--color-comment-menu-hovering: #6a6a6a;
|
--color-comment-menu-hovering: #6a6a6a;
|
||||||
|
--color-notice: #fef3ca;
|
||||||
|
|
||||||
// Text
|
// Text
|
||||||
--color-text-selection-bg: var(--color-secondary-alt);
|
--color-text-selection-bg: var(--color-secondary-alt);
|
||||||
|
|
Loading…
Add table
Reference in a new issue