Compare commits

..
25 changed files with 181 additions and 286 deletions

No files matched your search

-2
View File
@@ -20,7 +20,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Disk space setting under Data Hosting ([#7266](https://github.com/lbryio/lbry-desktop/pull/7266))
- Paginated 'All Playlists' page ([#7268](https://github.com/lbryio/lbry-desktop/pull/7268))
- Expanded playlist ordering tools ([#7305](https://github.com/lbryio/lbry-desktop/pull/7305))
- Setting to upgrade to alpha prerelease builds ([#7353](https://github.com/lbryio/lbry-desktop/pull/7353))
- Support for macOS arm64
### Changed
@@ -36,7 +35,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Cleaner Discover page filters ([#7306](https://github.com/lbryio/lbry-desktop/pull/7306))
- Scroll bar styling ([#7314](https://github.com/lbryio/lbry-desktop/pull/7314))
- Remove pages for obsolete features like invites, rewards, swap ([#7330](https://github.com/lbryio/lbry-desktop/pull/7330))
- Change file repost to modal _community pr!_ ([#7341](https://github.com/lbryio/lbry-desktop/pull/7341))
### Fixed
- Clicking on the title of a floating player will take you back to the list ([#6921](https://github.com/lbryio/lbry-desktop/pull/6921))
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "lbry",
"version": "0.52.0-alpha.10",
"version": "0.52.0-rc.8.3",
"description": "A browser for the LBRY network, a digital marketplace controlled by its users.",
"keywords": [
"lbry"
-10
View File
@@ -2225,15 +2225,5 @@
"Buy LBC": "Buy LBC",
"This is information like error logging, performance tracking, and usage statistics. It includes your IP address and basic system details, but no other identifying information (unless you connect to a cloud service)": "This is information like error logging, performance tracking, and usage statistics. It includes your IP address and basic system details, but no other identifying information (unless you connect to a cloud service)",
"Use official LBRY wallet servers": "Use official LBRY wallet servers",
"Enable Prerelease Updates": "Enable Prerelease Updates",
"Enable Upgrade to Test Builds": "Enable Upgrade to Test Builds",
"Prereleases may break things and we may not be able to fix them for you.": "Prereleases may break things and we may not be able to fix them for you.",
"Limit (GB)": "Limit (GB)",
"Limit Hosting for Content you Use": "Limit Hosting for Content you Use",
"Allow (GB)": "Allow (GB)",
"Content Data Hosting helps to seed things that you watch and download.": "Content Data Hosting helps to seed things that you watch and download.",
"Network Data Hosting allows the p2p network to store blobs unrelated to your browsing.": "Network Data Hosting allows the p2p network to store blobs unrelated to your browsing.",
"Content: Limit (GB)": "Content: Limit (GB)",
"Network: Allow (GB)": "Network: Allow (GB)",
"--end--": "--end--"
}
-6
View File
@@ -1,6 +0,0 @@
import { connect } from 'react-redux';
import { doOpenModal } from 'redux/actions/app';
import { doToast } from 'redux/actions/notifications';
import ClaimReportButton from './view';
export default connect(null, { doOpenModal, doToast })(ClaimReportButton);
-44
View File
@@ -1,44 +0,0 @@
// @flow
import { SITE_NAME } from 'config';
import * as MODALS from 'constants/modal_types';
import * as ICONS from 'constants/icons';
import React from 'react';
import Button from 'component/button';
type Props = {
uri: string,
claim: StreamClaim,
hasChannels: boolean,
doOpenModal: (string, {}) => void,
doToast: ({ message: string }) => void,
};
export default function ClaimRepostButton(props: Props) {
const { uri, claim, hasChannels, doOpenModal, doToast } = props;
const [contentUri, setContentUri] = React.useState('');
const [repostUri, setRepostUri] = React.useState('');
return (
<Button
button="alt"
className="button--file-action"
icon={ICONS.REPOST}
label={
claim.meta.reposted > 1 ? __(`%repost_total% Reposts`, { repost_total: claim.meta.reposted }) : __('Repost')
}
description={__('Repost')}
requiresAuth={IS_WEB}
onClick={() => {
if (!hasChannels) {
doToast({
message: __('A channel is required to repost on %SITE_NAME%', { SITE_NAME }),
linkText: __('Create Channel'),
linkTarget: '/channel/new',
});
} else {
doOpenModal(MODALS.REPOST, { uri, contentUri, setContentUri, repostUri, setRepostUri, isModal: true });
}
}}
/>
);
}
+1 -1
View File
@@ -513,7 +513,7 @@ export function CommentCreate(props: Props) {
)}
<FormField
disabled={isFetchingChannels}
type={advancedEditor ? 'markdown' : 'textarea'}
type={'textarea'}
name={isReply ? 'content_reply' : 'content_description'}
ref={formFieldRef}
className={isReply ? 'content_reply' : 'content_comment'}
+27 -4
View File
@@ -1,5 +1,5 @@
// @flow
import { ENABLE_FILE_REACTIONS } from 'config';
import { SITE_NAME, ENABLE_FILE_REACTIONS } from 'config';
import * as PAGES from 'constants/pages';
import * as MODALS from 'constants/modal_types';
import * as ICONS from 'constants/icons';
@@ -16,7 +16,6 @@ import { useHistory } from 'react-router';
import FileReactions from 'component/fileReactions';
import { Menu, MenuButton, MenuList, MenuItem } from '@reach/menu-button';
import Icon from 'component/common/icon';
import ClaimRepostButton from 'component/claimRepostButton';
type Props = {
uri: string,
@@ -28,6 +27,8 @@ type Props = {
costInfo: ?{ cost: number },
renderMode: string,
myChannels: ?Array<ChannelClaim>,
doToast: ({ message: string }) => void,
clearPlayingUri: () => void,
hideRepost?: boolean,
reactionsDisabled: boolean,
download: (string) => void,
@@ -45,12 +46,14 @@ function FileActions(props: Props) {
renderMode,
prepareEdit,
myChannels,
clearPlayingUri,
doToast,
hideRepost,
reactionsDisabled,
} = props;
const {
push,
location: { search },
location: { pathname, search },
} = useHistory();
const isMobile = useIsMobile();
const webShareable = costInfo && costInfo.cost === 0 && RENDER_MODES.WEB_SHAREABLE_MODES.includes(renderMode);
@@ -79,13 +82,33 @@ function FileActions(props: Props) {
const urlParams = new URLSearchParams(search);
const collectionId = urlParams.get(COLLECTIONS_CONSTS.COLLECTION_ID);
function handleRepostClick() {
if (!hasChannels) {
clearPlayingUri();
push(`/$/${PAGES.CHANNEL_NEW}?redirect=${pathname}`);
doToast({ message: __('A channel is required to repost on %SITE_NAME%', { SITE_NAME }) });
} else {
push(`/$/${PAGES.REPOST_NEW}?from=${encodeURIComponent(uri)}&redirect=${pathname}`);
}
}
const lhsSection = (
<>
{ENABLE_FILE_REACTIONS && !reactionsDisabled && <FileReactions uri={uri} />}
<ClaimSupportButton uri={uri} fileAction />
<ClaimCollectionAddButton uri={uri} fileAction />
{!hideRepost && (
<ClaimRepostButton uri={uri} claim={claim} hasChannels={hasChannels} />
<Button
button="alt"
className="button--file-action"
icon={ICONS.REPOST}
label={
claim.meta.reposted > 1 ? __(`%repost_total% Reposts`, { repost_total: claim.meta.reposted }) : __('Repost')
}
description={__('Repost')}
requiresAuth={IS_WEB}
onClick={handleRepostClick}
/>
)}
<Button
className="button--file-action"
+1 -1
View File
@@ -146,7 +146,7 @@ function PublishForm(props: Props) {
} else if (_uploadType) {
return mode === _uploadType;
} else {
return true;
return false;
}
});
+13 -25
View File
@@ -23,7 +23,6 @@ type Props = {
doToast: ({ message: string }) => void,
doClearRepostError: () => void,
doRepost: (StreamRepostOptions) => Promise<*>,
doHideModal: () => void,
title: string,
claim?: StreamClaim,
enteredContentClaim?: StreamClaim,
@@ -34,7 +33,11 @@ type Props = {
reposting: boolean,
uri: string,
name: string,
contentUri: string,
setRepostUri: (string) => void,
setContentUri: (string) => void,
doCheckPendingClaims: () => void,
redirectUri?: string,
passedRepostAmount: number,
enteredRepostAmount: number,
isResolvingPassedRepost: boolean,
@@ -42,16 +45,11 @@ type Props = {
activeChannelClaim: ?ChannelClaim,
fetchingMyChannels: boolean,
incognito: boolean,
contentUri: string,
setContentUri: (string) => void,
repostUri: string,
setRepostUri: (string) => void,
isModal: boolean,
redirectUri?: string,
};
function RepostCreate(props: Props) {
const {
redirectUri,
doToast,
doClearRepostError,
doRepost,
@@ -62,6 +60,9 @@ function RepostCreate(props: Props) {
doCheckPublishNameAvailability,
uri, // ?from
name, // ?to
contentUri,
setRepostUri,
setContentUri,
doCheckPendingClaims,
enteredRepostAmount,
passedRepostAmount,
@@ -70,12 +71,6 @@ function RepostCreate(props: Props) {
activeChannelClaim,
fetchingMyChannels,
incognito,
doHideModal,
contentUri,
setContentUri,
setRepostUri,
isModal,
redirectUri,
} = props;
const defaultName = name || (claim && claim.name) || '';
@@ -88,8 +83,8 @@ function RepostCreate(props: Props) {
const [available, setAvailable] = React.useState(true);
const [enteredContent, setEnteredContentUri] = React.useState(undefined);
const [contentError, setContentError] = React.useState('');
const { replace, goBack } = useHistory();
const { replace, goBack } = useHistory();
const resolvingRepost = isResolvingEnteredRepost || isResolvingPassedRepost;
const repostUrlName = `lbry://${incognito || !activeChannelClaim ? '' : `${activeChannelClaim.name}/`}`;
@@ -298,22 +293,14 @@ function RepostCreate(props: Props) {
linkText: __('Uploads'),
linkTarget: '/uploads',
});
if (isModal) {
doHideModal();
} else {
replace(getRedirect(contentUri, uri, redirectUri));
}
replace(getRedirect(contentUri, uri, redirectUri));
});
}
}
function cancelIt() {
doClearRepostError();
if (isModal) {
doHideModal();
} else {
goBack();
}
goBack();
}
if (fetchingMyChannels) {
@@ -326,10 +313,11 @@ function RepostCreate(props: Props) {
return (
<>
<ChannelSelector />
<Card
actions={
<div>
<ChannelSelector />
{uri && (
<fieldset-section>
<ClaimPreview key={uri} uri={uri} actions={''} showNullPlaceholder />
@@ -1,17 +0,0 @@
import SettingEnablePrereleases from './view';
import * as SETTINGS from 'constants/settings';
import { connect } from 'react-redux';
import { makeSelectClientSetting } from 'redux/selectors/settings';
import { doSetClientSetting } from 'redux/actions/settings';
const select = (state) => {
return {
enablePrereleases: makeSelectClientSetting(SETTINGS.ENABLE_PRERELEASE_UPDATES)(state),
};
};
const perform = (dispatch) => ({
setClientSetting: (value) => dispatch(doSetClientSetting(SETTINGS.ENABLE_PRERELEASE_UPDATES, value)),
});
export default connect(select, perform)(SettingEnablePrereleases);
@@ -1,25 +0,0 @@
// @flow
import React from 'react';
import { FormField } from 'component/common/form';
type Props = {
setClientSetting: (boolean) => void,
enablePrereleases: boolean,
};
function SettingEnablePrereleases(props: Props) {
const { setClientSetting, enablePrereleases } = props;
return (
<React.Fragment>
<FormField
type="checkbox"
name="prereleases"
onChange={() => {
setClientSetting(!enablePrereleases);
}}
checked={enablePrereleases}
/>
</React.Fragment>
);
}
export default SettingEnablePrereleases;
+59 -85
View File
@@ -17,9 +17,10 @@ import Spinner from 'component/spinner';
import { getPasswordFromCookie } from 'util/saved-passwords';
import * as DAEMON_SETTINGS from 'constants/daemon_settings';
import { formatBytes } from 'util/format-bytes';
import SettingEnablePrereleases from 'component/settingEnablePrereleases';
// @if TARGET='app'
const IS_MAC = process.platform === 'darwin';
// @endif
const BYTES_PER_MB = 1048576;
type Price = {
@@ -41,11 +42,8 @@ type DaemonSettings = {
type DaemonStatus = {
disk_space: {
content_blobs_storage_used_mb: string,
published_blobs_storage_used_mb: string,
running: true,
seed_blobs_storage_used_mb: string,
total_used_mb: string,
running: boolean,
space_used: string,
},
};
@@ -93,18 +91,15 @@ export default function SettingSystem(props: Props) {
const [clearingCache, setClearingCache] = React.useState(false);
const [storedPassword, setStoredPassword] = React.useState(false);
const { disk_space } = daemonStatus;
const contentSpaceUsed = Number(disk_space.content_blobs_storage_used_mb);
const networkSpaceUsed = Number(disk_space.seed_blobs_storage_used_mb);
const spaceUsed = Number(disk_space.space_used);
const blobLimitSetting = daemonSettings[DAEMON_SETTINGS.BLOB_STORAGE_LIMIT_MB];
const networkLimitSetting = daemonSettings[DAEMON_SETTINGS.NETWORK_STORAGE_LIMIT_MB];
const [contentBlobSpaceLimitGB, setContentBlobSpaceLimit] = React.useState(
blobLimitSetting ? blobLimitSetting / 1024 : 0
);
const [networkBlobSpaceLimitGB, setNetworkBlobSpaceLimit] = React.useState(
networkLimitSetting ? networkLimitSetting / 1024 : 0
);
const [blobSpaceLimitGB, setBlobSpaceLimit] = React.useState(blobLimitSetting ? blobLimitSetting / 1024 : 0);
// const debouncedBlobSpaceLimitGB = useDebounce(blobSpaceLimitGB || 0, 500);
const [limitSpace, setLimitSpace] = React.useState(Boolean(blobLimitSetting));
console.log('spaceUsed', spaceUsed, 'blobLimit', blobLimitSetting);
// @if TARGET='app'
const { available: ffmpegAvailable, which: ffmpegPath } = ffmpegStatus;
// @endif
function onChangeEncryptWallet() {
if (walletEncrypted) {
@@ -118,19 +113,11 @@ export default function SettingSystem(props: Props) {
confirmForgetPassword({ callback: () => setStoredPassword(false) });
}
function updateContentBlobLimitField(gb) {
function updateBlobLimitField(gb) {
if (gb === 0) {
setContentBlobSpaceLimit(0);
setBlobSpaceLimit(0);
} else if (!gb || !isNaN(gb)) {
setContentBlobSpaceLimit(gb);
}
}
function updateNetworkBlobLimitField(gb) {
if (gb === 0) {
setNetworkBlobSpaceLimit(0);
} else if (!gb || !isNaN(gb)) {
setNetworkBlobSpaceLimit(gb);
setBlobSpaceLimit(gb);
}
}
@@ -139,27 +126,21 @@ export default function SettingSystem(props: Props) {
if (!value) {
setDaemonSetting(DAEMON_SETTINGS.BLOB_STORAGE_LIMIT_MB, String(0));
} else {
const spaceLimitMB = contentBlobSpaceLimitGB * 1024;
const spaceLimitMB = blobSpaceLimitGB * 1024;
setDaemonSetting(DAEMON_SETTINGS.BLOB_STORAGE_LIMIT_MB, String(spaceLimitMB));
}
}
function handleSetContentBlobSpaceLimit() {
const spaceLimitMB = contentBlobSpaceLimitGB * 1024;
function handleSetBlobSpaceLimit() {
const spaceLimitMB = blobSpaceLimitGB * 1024;
if (!isNaN(spaceLimitMB) && blobLimitSetting !== spaceLimitMB * 1024) {
setDaemonSetting(DAEMON_SETTINGS.BLOB_STORAGE_LIMIT_MB, String(spaceLimitMB));
}
}
function handleSetNetworkBlobSpaceLimit() {
const spaceLimitMB = networkBlobSpaceLimitGB * 1024;
if (!isNaN(spaceLimitMB) && blobLimitSetting !== spaceLimitMB * 1024) {
setDaemonSetting(DAEMON_SETTINGS.NETWORK_STORAGE_LIMIT_MB, String(spaceLimitMB));
}
}
// Update ffmpeg variables
React.useEffect(() => {
// @if TARGET='app'
const { available } = ffmpegStatus;
const { ffmpeg_path: ffmpegPath } = daemonSettings;
if (!available) {
@@ -168,6 +149,7 @@ export default function SettingSystem(props: Props) {
}
findFFmpeg();
}
// @endif
}, []); // eslint-disable-line react-hooks/exhaustive-deps
// Update storedPassword state
@@ -204,6 +186,7 @@ export default function SettingSystem(props: Props) {
</SettingsRow>
{/* @endif */}
{/* @if TARGET='app' */}
<SettingsRow
title={__('Save all viewed content to your downloads directory')}
subtitle={__(
@@ -222,23 +205,16 @@ export default function SettingSystem(props: Props) {
multirow
subtitle={
<React.Fragment>
{__('Content Data Hosting helps to seed things that you watch and download.')}{' '}
{__('Network Data Hosting allows the p2p network to store blobs unrelated to your browsing.')}{' '}
{__("If disabled, LBRY will be very sad and you won't be helping improve the network.")}{' '}
{__('If you set a limit, playing videos may exceed your limit until cleanup runs every 30 minutes.')}{' '}
<Button button="link" label={__('Learn more')} href="https://lbry.com/faq/host-content" />.
<p className={'help'}>
{`Content Hosting using ${formatBytes(contentSpaceUsed * BYTES_PER_MB)} of ${
{`Using ${formatBytes(spaceUsed * BYTES_PER_MB)} of ${
daemonSettings[DAEMON_SETTINGS.BLOB_STORAGE_LIMIT_MB]
? formatBytes(daemonSettings[DAEMON_SETTINGS.BLOB_STORAGE_LIMIT_MB] * BYTES_PER_MB)
: 'Unlimited'
}`}
</p>
<p className={'help'}>
{`Network Hosting using ${formatBytes(networkSpaceUsed * BYTES_PER_MB)} of ${formatBytes(
daemonSettings[DAEMON_SETTINGS.NETWORK_STORAGE_LIMIT_MB] * BYTES_PER_MB
)}`}
</p>
</React.Fragment>
}
>
@@ -251,55 +227,41 @@ export default function SettingSystem(props: Props) {
label={__('Enable Data Hosting')}
/>
</fieldset-section>
{daemonSettings.save_blobs && (
<fieldset-section>
<FormField
type="checkbox"
name="limit_space_used"
onChange={() => handleLimitSpace(!limitSpace)}
checked={limitSpace}
label={__('Limit Hosting for Content you Use')}
/>
</fieldset-section>
)}
{daemonSettings.save_blobs && limitSpace && (
<fieldset-section>
<FormField
name="content_blob_limit_gb"
type="text"
label={__(`Content: Limit (GB)`)}
disabled={!daemonSettings.save_blobs}
onChange={(e) => updateContentBlobLimitField(e.target.value)}
value={contentBlobSpaceLimitGB}
inputButton={
<Button
disabled={isNaN(contentBlobSpaceLimitGB)}
button="primary"
label={__('Apply')}
onClick={handleSetContentBlobSpaceLimit}
/>
}
type="checkbox"
name="limit_space_used"
onChange={() => handleLimitSpace(!limitSpace)}
checked={limitSpace}
label={__('Limit Space Used')}
/>
)}
{daemonSettings.save_blobs && (
</fieldset-section>
{limitSpace && (
<FormField
name="network_blob_limit_gb"
name="blob_limit_gb"
type="text"
label={__(`Network: Allow (GB)`)}
label={__(`Limit (GB)`)}
helper={__(
'Data over the limit will be deleted within 30 minutes. This will make the Yrbl cry a little bit.'
)}
disabled={!daemonSettings.save_blobs}
onChange={(e) => updateNetworkBlobLimitField(e.target.value)}
value={networkBlobSpaceLimitGB}
onChange={(e) => updateBlobLimitField(e.target.value)}
value={blobSpaceLimitGB}
inputButton={
<Button
disabled={isNaN(networkBlobSpaceLimitGB)}
disabled={isNaN(blobSpaceLimitGB)}
button="primary"
label={__('Apply')}
onClick={handleSetNetworkBlobSpaceLimit}
onClick={handleSetBlobSpaceLimit}
/>
}
/>
)}
</SettingsRow>
{/* @endif */}
{/* @if TARGET='app' */}
<SettingsRow
title={__('Share usage and diagnostic data')}
subtitle={
@@ -334,6 +296,9 @@ export default function SettingSystem(props: Props) {
helper={__('We use detailed analytics to improve all aspects of the LBRY experience.')}
/>
</SettingsRow>
{/* @endif */}
{/* @if TARGET='app' */}
{/* Auto launch in a hidden state doesn't work on mac https://github.com/Teamwork/node-auto-launch/issues/81 */}
{!IS_MAC && (
<SettingsRow
@@ -345,15 +310,15 @@ export default function SettingSystem(props: Props) {
<SettingAutoLaunch noLabels />
</SettingsRow>
)}
{/* @endif */}
{/* @if TARGET='app' */}
<SettingsRow title={__('Leave app running in notification area when the window is closed')}>
<SettingClosingBehavior noLabels />
</SettingsRow>
<SettingsRow
title={__('Enable Upgrade to Test Builds')}
subtitle={__('Prereleases may break things and we may not be able to fix them for you.')}
>
<SettingEnablePrereleases />
</SettingsRow>
{/* @endif */}
{/* @if TARGET='app' */}
<SettingsRow
title={
<span>
@@ -414,6 +379,9 @@ export default function SettingSystem(props: Props) {
)}
</p>
</SettingsRow>
{/* @endif */}
{/* @if TARGET='app' */}
<SettingsRow
title={__('Encrypt my wallet with a custom password')}
subtitle={
@@ -456,6 +424,9 @@ export default function SettingSystem(props: Props) {
/>
</SettingsRow>
)}
{/* @endif */}
{/* @if TARGET='app' */}
<SettingsRow
title={__('Max connections')}
subtitle={__(
@@ -475,6 +446,7 @@ export default function SettingSystem(props: Props) {
)}
/>
*/}
<fieldset-section>
<FormField
name="max_connections"
@@ -503,6 +475,8 @@ export default function SettingSystem(props: Props) {
<SettingsRow title={__('Share url')} multirow>
<SettingShareUrl />
</SettingsRow>
{/* @endif */}
<SettingsRow
title={__('Clear application cache')}
subtitle={__('This might fix issues that you are having. Your wallet will not be affected.')}
+3
View File
@@ -1,12 +1,15 @@
import { connect } from 'react-redux';
import { makeSelectClaimForUri, makeSelectTitleForUri } from 'redux/selectors/claims';
import SocialShare from './view';
import { selectUserInviteReferralCode, selectUser } from 'redux/selectors/user';
import { makeSelectContentPositionForUri } from 'redux/selectors/content';
import { makeSelectClientSetting } from 'redux/selectors/settings';
import * as SETTINGS from 'constants/settings';
const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state),
referralCode: selectUserInviteReferralCode(state),
user: selectUser(state),
title: makeSelectTitleForUri(props.uri)(state),
position: makeSelectContentPositionForUri(props.uri)(state),
customShareUrlEnabled: makeSelectClientSetting(SETTINGS.CUSTOM_SHARE_URL_ENABLED)(state),
+17 -3
View File
@@ -22,6 +22,8 @@ type Props = {
claim: StreamClaim,
title: ?string,
webShareable: boolean,
referralCode: string,
user: any,
position: number,
collectionId?: number,
customShareUrlEnabled: boolean,
@@ -29,7 +31,17 @@ type Props = {
};
function SocialShare(props: Props) {
const { claim, title, webShareable, position, collectionId, customShareUrlEnabled, customShareUrl } = props;
const {
claim,
title,
referralCode,
user,
webShareable,
position,
collectionId,
customShareUrlEnabled,
customShareUrl,
} = props;
const [showEmbed, setShowEmbed] = React.useState(false);
const [includeCollectionId, setIncludeCollectionId] = React.useState(Boolean(collectionId)); // unless it *is* a collection?
const [showClaimLinks, setShowClaimLinks] = React.useState(false);
@@ -50,6 +62,7 @@ function SocialShare(props: Props) {
const isVideo = isStream && claim.value.stream_type === 'video';
const isAudio = isStream && claim.value.stream_type === 'audio';
const showStartAt = isVideo || isAudio;
const rewardsApproved = user && user.is_reward_approved;
const lbryUrl: string = generateLbryContentUrl(canonicalUrl, permanentUrl);
const lbryWebUrl: string = generateLbryWebUrl(lbryUrl);
const includedCollectionId = collectionId && includeCollectionId ? collectionId : null;
@@ -63,8 +76,8 @@ function SocialShare(props: Props) {
const shareUrl: string = generateShareUrl(
shareDomain,
lbryUrl,
null,
null,
referralCode,
rewardsApproved,
includeStartTime,
startTimeSeconds,
includedCollectionId
@@ -201,6 +214,7 @@ function SocialShare(props: Props) {
claim={claim}
includeStartTime={includeStartTime}
startTime={startTimeSeconds}
referralCode={referralCode}
/>
)}
{showClaimLinks && (
@@ -34,7 +34,7 @@ class TouchOverlay extends Component {
this.addChild('playToggle', {});
// Clear overlay when playback starts or with control fade
player.on(['playing', 'userinactive'], (e) => {
player.on(['playing', 'userinactive'], e => {
if (!this.player_.paused()) {
this.removeClass('show-play-toggle');
}
@@ -104,6 +104,27 @@ class TouchOverlay extends Component {
handleSingleTap(event) {
this.removeClass('skip');
this.toggleClass('show-play-toggle');
// At the moment, we only have one <video> tag at a time, but just loops it
// all to somewhat future-proof it.
const videos = document.getElementsByTagName('video');
for (let video of videos) {
// The Android-Chrome cast button appears when you tap directly on the
// video. If anything exists above it, such as our mobile-ui overlay, the
// action will be absorbed, causing the button to not appear. So, I've
// tried to pass on the tap event by manually dispatching one, but it
// didn't work.
// Peeking at the Android-Chrome code, the cast button is refreshed when
// the 'controllist' is updated. Since we don't use this attribute as we
// are using the videojs controls, I'm "toggling" this attribute to force
// the cast button to be refreshed.
const attr = video.getAttribute('controlslist');
if (!attr || attr.indexOf('dummy') === -1) {
video.setAttribute('controlslist', 'dummy');
} else {
video.removeAttribute('controlslist');
}
}
}
/**
-1
View File
@@ -38,4 +38,3 @@ export const USE_UPNP = 'use_upnp';
export const WALLET_DIR = 'wallet_dir';
export const WALLETS = 'wallets';
export const BLOB_STORAGE_LIMIT_MB = 'blob_storage_limit';
export const NETWORK_STORAGE_LIMIT_MB = 'network_storage_limit';
-1
View File
@@ -19,7 +19,6 @@ export const AFFIRM_PURCHASE = 'affirm_purchase';
export const CONFIRM_CLAIM_REVOKE = 'confirm_claim_revoke';
export const FIRST_SUBSCRIPTION = 'firstSubscription';
export const SEND_TIP = 'send_tip';
export const REPOST = 'repost';
export const CONFIRM_SEND_TIP = 'confirm_send_tip';
export const SOCIAL_SHARE = 'social_share';
export const PUBLISH = 'publish';
-1
View File
@@ -43,7 +43,6 @@ export const CUSTOM_COMMENTS_SERVER_ENABLED = 'custom_comments_server_enabled';
export const CUSTOM_COMMENTS_SERVER_URL = 'custom_comments_server_url';
export const CUSTOM_SHARE_URL_ENABLED = 'custom_share_url_enabled';
export const CUSTOM_SHARE_URL = 'custom_share_url';
export const ENABLE_PRERELEASE_UPDATES = 'enable_prerelease_updates';
export const SETTINGS_GRP = {
APPEARANCE: 'appearance',
-12
View File
@@ -11,7 +11,6 @@ import * as MODALS from 'constants/modal_types';
import React, { Fragment, useState, useEffect } from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import * as SETTINGS from 'constants/settings';
import {
doDaemonReady,
doAutoUpdate,
@@ -34,7 +33,6 @@ import { PersistGate } from 'redux-persist/integration/react';
import analytics from 'analytics';
import { doToast } from 'redux/actions/notifications';
import { getAuthToken, setAuthToken, doAuthTokenRefresh } from 'util/saved-passwords';
import { makeSelectClientSetting } from 'redux/selectors/settings';
import { DEFAULT_LANGUAGE, LBRY_API_URL } from 'config';
// Import 3rd-party styles before ours for the current way we are code-splitting.
@@ -187,16 +185,6 @@ function AppWrapper() {
const [readyToLaunch, setReadyToLaunch] = useState(IS_WEB);
const [persistDone, setPersistDone] = useState(false);
useEffect(() => {
if (persistDone) {
const state = store.getState();
const enabled = makeSelectClientSetting(SETTINGS.ENABLE_PRERELEASE_UPDATES)(state);
if (enabled) {
autoUpdater.allowPrerelease = true;
}
}
}, [persistDone]);
useEffect(() => {
// @if TARGET='app'
moment.locale(remote.app.getLocale());
-9
View File
@@ -1,9 +0,0 @@
import { connect } from 'react-redux';
import { doHideModal } from 'redux/actions/app';
import ModalRepost from './view';
const perform = dispatch => ({
closeModal: () => dispatch(doHideModal()),
});
export default connect(null, perform)(ModalRepost);
-32
View File
@@ -1,32 +0,0 @@
// @flow
import React from 'react';
import { Modal } from 'modal/modal';
import RepostCreate from 'component/repostCreate';
import Card from 'component/common/card';
type Props = {
closeModal: () => void,
uri: string,
name: string,
contentUri: string,
setContentUri: () => void,
repostUri: string,
setRepostUri: () => void,
}
class ModalRepost extends React.PureComponent<Props> {
render() {
const { closeModal, uri, name, contentUri, setContentUri, repostUri, setRepostUri } = this.props;
return (
<Modal onAborted={closeModal} isOpen type="card">
<Card
title={__('Repost')}
actions={<RepostCreate isModal uri={uri} name={name} onCancel={closeModal} contentUri={contentUri} setContentUri={setContentUri} repostUri={repostUri} setRepostUri={setRepostUri} />}
/>
</Modal>
);
}
}
export default ModalRepost;
-3
View File
@@ -53,7 +53,6 @@ import ModalRemoveFile from 'modal/modalRemoveFile';
import ModalRevokeClaim from 'modal/modalRevokeClaim';
import ModalRewardCode from 'modal/modalRewardCode';
import ModalSendTip from 'modal/modalSendTip';
import ModalRepost from 'modal/modalRepost';
import ModalSetReferrer from 'modal/modalSetReferrer';
import ModalSignOut from 'modal/modalSignOut';
import ModalSocialShare from 'modal/modalSocialShare';
@@ -125,8 +124,6 @@ function ModalRouter(props: Props) {
return ModalFirstSubscription;
case MODALS.SEND_TIP:
return ModalSendTip;
case MODALS.REPOST:
return ModalRepost;
case MODALS.SOCIAL_SHARE:
return ModalSocialShare;
case MODALS.PUBLISH:
-1
View File
@@ -80,7 +80,6 @@ const defaultState = {
// OS
[SETTINGS.AUTO_LAUNCH]: true,
[SETTINGS.TO_TRAY_WHEN_CLOSED]: true,
[SETTINGS.ENABLE_PRERELEASE_UPDATES]: false,
},
};
defaultState.clientSettings[SETTINGS.AUTOPLAY_NEXT] = defaultState.clientSettings[SETTINGS.AUTOPLAY_MEDIA];
+1 -1
View File
@@ -37,7 +37,7 @@ export const makeSelectDownloadingForUri = (uri) =>
return byOutpoint[fileInfo.outpoint];
});
export const selectUrisLoading = createSelector(selectState, (state) => state.fetching || {});
export const selectUrisLoading = createSelector(selectState, (state) => state.urisLoading || {});
export const makeSelectLoadingForUri = (uri) =>
createSelector(selectUrisLoading, makeSelectClaimForUri(uri), (fetchingByOutpoint, claim) => {
+36
View File
@@ -474,6 +474,42 @@
&.skip {
background-color: rgba(0, 0, 0, 0.5);
}
// Override the original's 'display: block' to avoid the big play button
// from being squished to the side:
position: absolute;
}
}
video::-internal-media-controls-overlay-cast-button {
// Push the cast button above vjs-touch-overlay:
z-index: 3;
// Move it to the upper-right since it will clash with "tap to unmute":
left: unset;
right: 8px;
}
.video-js.video-js.vjs-user-inactive {
video::-internal-media-controls-overlay-cast-button {
// (1) Android-Chrome's original Cast button behavior:
// - If video is playing, fade out the button.
// - If video is paused and video is tapped, display the button and stay on.
// (2) We then injected another behavior:
// - Display the button when '.vjs-touch-overlay' is displayed. However,
// the 'controlslist' attribute hack that was used to do this results in the
// button staying displayed without a fade-out timer.
// (3) Ideally, we should sync the '.vjs-touch-overlay' visibility with the
// cast button, similar to how to controlBar's visibility is synced above.
// But I have no idea how to grab the sibling '.show-play-toggle' into the
// css logic.
// (4) So, this is the best that I can come up with: Whenever user is idle,
// the button goes away. The only downside I know is the scenario of
// "overlay is up and video is paused, but button goes away due to idle".
// The user just needs to re-tap any empty space on the overlay to get the
// Cast button again.
opacity: 0;
transition: opacity 1s ease;
}
}