Compare commits

..
Author SHA1 Message Date
zeppi 6a51d252a8 fix rebase more 2021-11-13 16:23:56 -05:00
89 changed files with 1791 additions and 1075 deletions

No files matched your search

+1 -18
View File
@@ -24,7 +24,7 @@ jobs:
os:
- ubuntu-latest
- macos-latest
# - windows-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
@@ -56,11 +56,6 @@ jobs:
NOTARIZATION_PASSWORD: ${{ secrets.NOTARIZATION_PASSWORD }}
WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
ARTIFACTS_BUCKET: ${{ secrets.ARTIFACTS_BUCKET }}
ARTIFACTS_KEY: ${{ secrets.ARTIFACTS_KEY }}
ARTIFACTS_SECRET: ${{ secrets.ARTIFACTS_SECRET }}
ARTIFACTS_REGION: ${{ secrets.ARTIFACTS_REGION }}
WIN_CSC_LINK: https://raw.githubusercontent.com/lbryio/lbry-desktop/master/build/win-csc-2021-2022-08.p12
CSC_LINK: https://s3.amazonaws.com/files.lbry.io/cert/osx-csc-2021-2022.p12
@@ -103,15 +98,3 @@ jobs:
with:
name: Windows
path: ./dist/electron/*.*
- uses: jakejarvis/s3-sync-action@master
if: |
startsWith(runner.os, 'linux')
with:
args: --acl public-read --follow-symlinks --exclude '*' --include '*.deb' --include '*.AppImage' --include '*.dmg'
env:
AWS_S3_BUCKET: ${{ secrets.ARTIFACTS_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.ARTIFACTS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.ARTIFACTS_SECRET }}
AWS_REGION: 'us-east-1'
SOURCE_DIR: 'dist/electron'
DEST_DIR: 'app/release'
+4 -14
View File
@@ -6,20 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased for Desktop]
## [0.52.0] - [2021-10-24]
### Compatibility
- Mac <= 10.13 (High Sierra) and Ubuntu <= 16 (Xenial) are no longer supported. If you upgrade, you will need to manually build and install your own lbrynet SDK
### Added
- Direct replying to notifications _community pr!_ ([#6935](https://github.com/lbryio/lbry-desktop/pull/6935))
- Added direct replying to notifications _community pr!_ ([#6935](https://github.com/lbryio/lbry-desktop/pull/6935))
- Added "Replay" option on autoplay countdown ([#6921](https://github.com/lbryio/lbry-desktop/pull/6921))
- Added "Loop" option on Lists ([#6921](https://github.com/lbryio/lbry-desktop/pull/6921))
- Added "Shuffle" option on Lists ([#6921](https://github.com/lbryio/lbry-desktop/pull/6921))
- Added Play Next/Previous buttons (with shortcuts SHIFT+N/SHIFT+P) ([#6921](https://github.com/lbryio/lbry-desktop/pull/6921))
- Separate control for autoplay next on video player ([#6921](https://github.com/lbryio/lbry-desktop/pull/6921))
- Channel Mention selection ability while creating a comment ([#7151](https://github.com/lbryio/lbry-desktop/pull/7151))
- 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))
- Added separate control for autoplay next on video player ([#6921](https://github.com/lbryio/lbry-desktop/pull/6921))
- Added Channel Mention selection ability while creating a comment ([#7151](https://github.com/lbryio/lbry-desktop/pull/7151))
### Changed
- Changing the supported language from Filipino to Tagalog _community pr!_ ([#6951](https://github.com/lbryio/lbry-desktop/pull/6951))
@@ -29,10 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Styling cleanup for file reactions ([#7251](https://github.com/lbryio/lbry-desktop/pull/7251))
- Change share url to odysee and allow custom share url in settings ([#7258](https://github.com/lbryio/lbry-desktop/pull/7258))
- Change Sign in/up to Cloud Connect for Odysee ([#7260](https://github.com/lbryio/lbry-desktop/pull/7260))
- Upgraded to lbrynet v0.106.0 ([#7315](https://github.com/lbryio/lbry-desktop/pull/7315))
- Upgraded Electron to v11.5.0 ([#7276](https://github.com/lbryio/lbry-desktop/pull/7276))
- 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))
- Upgraded to lbrynet v0.103.0 ([#7265](https://github.com/lbryio/lbry-desktop/pull/7265))
### 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))
@@ -42,7 +33,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix playlist preview thumbnail ([#7178](https://github.com/lbryio/lbry-desktop/pull/7178)
- Fixed “Your Account” popup on mobile ([#7172](https://github.com/lbryio/lbry-desktop/pull/7172))
- Fix disable-support for comments ([#7245](https://github.com/lbryio/lbry-desktop/pull/7245))
- Fix Electron taking over .html files on linux ([#7291](https://github.com/lbryio/lbry-desktop/pull/7291))
## [0.51.2] - [2021-08-20]
+62 -2
View File
@@ -1,8 +1,8 @@
<img width="40%" src="https://miro.medium.com/max/5198/1*bTVuL2THG_0mpwmE-n7Ezg.png" />
# LBRY App
# LBRY App - https://lbry.tv
This repo contains the UI code that powers the official LBRY desktop app. The LBRY app is a graphical browser for the decentralized content marketplace provided by the
This repo contains the UI code that powers the official LBRY desktop app, as well as lbry.tv. The LBRY app is a graphical browser for the decentralized content marketplace provided by the
[LBRY](https://lbry.com) protocol. It is essentially the
[lbry daemon](https://github.com/lbryio/lbry) bundled with a UI using
[Electron](https://electron.atom.io/).
@@ -92,6 +92,66 @@ You can run the web version (lbry.tv), the electron app, or both at the same tim
- If you want to build and launch the production app you can run `yarn build`. This will give you an executable inside the `/dist` folder. We use [electron-builder](https://github.com/electron-userland/electron-builder) to create distributable packages.
#### Run the web app for development
`yarn dev:web`
- This uses webpack-dev-server and includes hot-reloading. If you want to debug the [web server we use in production](https://github.com/lbryio/lbry-desktop/blob/master/web/index.js) you can run `yarn dev:web-server`. This starts a server at `localhost:1337` and does not include hot reloading.
#### Customize the web app
- In root directory, duplicate the .env.default file and rename it to .env then copy the code below and paste it anywhere in the .env file.
```
cp .env.defaults .env
nano .env
```
- To specify your own OG-IMAGE
You can either place a png named v2-og.png in the /custom folder or specify the OG_IMAGE_URL in .env
- To specify your own channels to be followed on first run
`AUTO_FOLLOW_URLS=lbry://@chan#123...a lbry://@chan2#456...a`
- If you want to customize the homepage content
1. add `CUSTOM_HOMEPAGE=true` to the '.env' file
2. copy `/custom/homepage.example.js` to `/custom/homepage.js` and make desired changes to `homepage.js`
- If you want up to two custom sidebar links
```
PINNED_URI_1=@someurl#2/someclaim#4
PINNED_LABEL_1=Linktext
PINNED_URI_2=$/discover?t=tag&[queryparams]
PINNED_LABEL_2=OtherLinkText
```
- Finally `NODE_ENV=production yarn compile:web` to rebuild
_Note: You don't need to edit the .env file in the /web folder - that is copied during compile._
#### Deploy the web app (_experimental_)
1. Create a server with a domain name and a reverse proxy https to port 1337.
2. Install pm2, node v10, yarn
3. Clone this repo
4. Make any customizations as above
5. Run `yarn` to install
6. Run `NODE_ENV=production yarn compile:web` to build
7. Set up pm2 to start ./web/index.js
#### Run both at the same time
Run the two commands above in separate terminal windows
```
yarn dev
// in another terminal window
yarn dev:web
```
#### Resetting your Packages
If the app isn't building, or `yarn xxx` commands aren't working you may need to just reset your `node_modules`. To do so you can run: `rm -r node_modules && yarn` or `del /s /q node_modules && yarn` on Windows.
+1 -1
View File
@@ -82,7 +82,7 @@
}
},
"deb": {
"depends": ["gconf2", "gconf-service", "libnotify4", "libxtst6", "libnss3"]
"depends": ["gconf2", "gconf-service", "libnotify4", "libappindicator1", "libxtst6", "libnss3"]
},
"nsis": {
"perMachine": true,
-1
View File
@@ -54,7 +54,6 @@ export default appState => {
webSecurity: !isDev,
plugins: true,
nodeIntegration: true,
enableRemoteModule: true, // see about removing this
},
};
const lbryProto = 'lbry://';
+2 -21
View File
@@ -4,7 +4,7 @@
import '@babel/polyfill';
import SemVer from 'semver';
import https from 'https';
import { app, dialog, ipcMain, session, shell, BrowserWindow } from 'electron';
import { app, dialog, ipcMain, session, shell } from 'electron';
import { autoUpdater } from 'electron-updater';
import Lbry from 'lbry';
import LbryFirstInstance from './LbryFirstInstance';
@@ -17,7 +17,6 @@ import startSandbox from './startSandbox';
import installDevtools from './installDevtools';
import fs from 'fs';
import path from 'path';
const { download } = require('electron-dl');
const filePath = path.join(process.resourcesPath, 'static', 'upgradeDisabled');
let upgradeDisabled;
try {
@@ -53,7 +52,7 @@ if (isDev && process.platform === 'win32') {
app.setAsDefaultProtocolClient(PROTOCOL, process.execPath, [
path.resolve(process.argv[1]),
]);
} else if (process.platform !== 'linux') {
} else {
app.setAsDefaultProtocolClient(PROTOCOL);
}
@@ -284,20 +283,6 @@ app.on('before-quit', () => {
appState.isQuitting = true;
});
ipcMain.on('download-upgrade', async (event, params) => {
const { url, options } = params;
const dir = fs.mkdtempSync(app.getPath('temp') + path.sep);
options.onProgress = function(p) {
rendererWindow.webContents.send('download-progress-update', p);
};
options.directory = dir;
options.onCompleted = function(c) {
rendererWindow.webContents.send('download-update-complete', c);
};
const win = BrowserWindow.getFocusedWindow();
await download(win, url, options).catch(e => console.log('e', e));
});
ipcMain.on('upgrade', (event, installerPath) => {
app.on('quit', () => {
console.log('Launching upgrade installer at', installerPath);
@@ -312,10 +297,6 @@ ipcMain.on('upgrade', (event, installerPath) => {
app.quit();
});
ipcMain.on('check-for-updates', () => {
autoUpdater.checkForUpdates();
});
autoUpdater.on('update-downloaded', () => {
autoUpdateDownloaded = true;
});
-1
View File
@@ -45,7 +45,6 @@ declare type CommentsState = {
isLoading: boolean,
isLoadingById: boolean,
isLoadingByParentId: { [string]: boolean },
isCommenting: boolean,
myComments: ?Set<string>,
isFetchingReacts: boolean,
myReactsByCommentId: ?{ [string]: Array<string> }, // {"CommentId:MyChannelId": ["like", "dislike", ...]}
-43
View File
@@ -91,46 +91,3 @@ declare type NotificationState = {
errors: Array<ErrorNotification>,
toasts: Array<Toast>,
};
declare type WebNotification = {
active_at: string,
created_at: string,
id: number,
is_app_readable: boolean,
is_device_notified: boolean,
is_emailed: boolean,
is_read: boolean,
is_seen: boolean,
notification_parameters: {
device: {
analytics_label: string,
image_url: string,
is_data_only: boolean,
name: string,
placeholders: ?string,
target: string,
text: string,
title: string,
type: string,
},
dynamic: {
comment_author: string,
reply_author: string,
hash: string,
claim_title: string,
comment?: string,
channel_url: string,
},
email: {},
},
notification_rule: string,
type: string,
updated_at: string,
user_id: number,
group_count?: number,
};
declare type NotificationCategory = {
name: string,
types: ?Array<string>,
};
+1 -28
View File
@@ -11,44 +11,17 @@ declare type UpdatePublishFormData = {
thumbnail_url?: string,
uploadThumbnailStatus?: string,
thumbnailPath?: string,
thumbnailError?: boolean,
description?: string,
language?: string,
channel?: string,
channelId?: string,
name?: string,
nameError?: string,
bid?: number,
bid?: string,
bidError?: string,
otherLicenseDescription?: string,
licenseUrl?: string,
licenseType?: string,
uri?: string,
nsfw: boolean,
isMarkdownPost?: boolean,
};
declare type PublishParams = {
name: ?string,
bid: ?number,
filePath?: string,
description: ?string,
language: string,
publishingLicense?: string,
publishingLicenseUrl?: string,
thumbnail: ?string,
channel: string,
channelId?: string,
title: string,
contentIsFree: boolean,
uri?: string,
license: ?string,
licenseUrl: ?string,
fee?: {
amount: string,
currency: string,
},
claim: StreamClaim,
nsfw: boolean,
tags: Array<Tag>,
};
+93
View File
@@ -0,0 +1,93 @@
// @flow
import * as ACTIONS from 'constants/action_types';
/*
Toasts:
- First-in, first-out queue
- Simple messages that are shown in response to user interactions
- Never saved
- If they are the result of errors, use the isError flag when creating
- For errors that should interrupt user behavior, use Error
*/
declare type ToastParams = {
message: string,
title?: string,
linkText?: string,
linkTarget?: string,
isError?: boolean,
};
declare type Toast = {
id: string,
params: ToastParams,
};
declare type DoToast = {
type: ACTIONS.CREATE_TOAST,
data: Toast,
};
/*
Notifications:
- List of notifications based on user interactions/app notifications
- Always saved, but can be manually deleted
- Can happen in the background, or because of user interaction (ex: publish confirmed)
*/
declare type Notification = {
id: string, // Unique id
dateCreated: number,
isRead: boolean, // Used to display "new" notifications that a user hasn't seen yet
source?: string, // The type/area an notification is from. Used for sorting (ex: publishes, transactions)
// We may want to use priority/isDismissed in the future to specify how urgent a notification is
// and if the user should see it immediately
// isDissmied: boolean,
// priority?: number
};
declare type DoNotification = {
type: ACTIONS.CREATE_NOTIFICATION,
data: Notification,
};
declare type DoEditNotification = {
type: ACTIONS.EDIT_NOTIFICATION,
data: {
notification: Notification,
},
};
declare type DoDeleteNotification = {
type: ACTIONS.DELETE_NOTIFICATION,
data: {
id: string, // The id to delete
},
};
/*
Errors:
- First-in, first-out queue
- Errors that should interupt user behavior
- For errors that can be shown without interrupting a user, use Toast with the isError flag
*/
declare type ErrorNotification = {
title: string,
text: string,
};
declare type DoError = {
type: ACTIONS.CREATE_ERROR,
data: ErrorNotification,
};
declare type DoDismissError = {
type: ACTIONS.DISMISS_ERROR,
};
/*
NotificationState
*/
declare type NotificationState = {
notifications: Array<Notification>,
errors: Array<ErrorNotification>,
toasts: Array<Toast>,
};
+54
View File
@@ -0,0 +1,54 @@
// @flow
declare type UpdatePublishFormData = {
filePath?: string,
contentIsFree?: boolean,
fee?: {
amount: string,
currency: string,
},
title?: string,
thumbnail_url?: string,
uploadThumbnailStatus?: string,
thumbnailPath?: string,
thumbnailError?: boolean,
description?: string,
language?: string,
channel?: string,
channelId?: string,
name?: string,
nameError?: string,
bid?: number,
bidError?: string,
otherLicenseDescription?: string,
licenseUrl?: string,
licenseType?: string,
uri?: string,
nsfw: boolean,
isMarkdownPost?: boolean,
};
declare type PublishParams = {
name: ?string,
bid: ?number,
filePath?: string,
description: ?string,
language: string,
publishingLicense?: string,
publishingLicenseUrl?: string,
thumbnail: ?string,
channel: string,
channelId?: string,
title: string,
contentIsFree: boolean,
uri?: string,
license: ?string,
licenseUrl: ?string,
fee?: {
amount: string,
currency: string,
},
claim: StreamClaim,
nsfw: boolean,
tags: Array<Tag>,
};
+6
View File
@@ -0,0 +1,6 @@
// @flow
/* eslint-disable no-use-before-define */
declare type GetState = () => any;
declare type ThunkAction = (dispatch: Dispatch, getState: GetState) => any;
declare type Dispatch = (action: {} | Promise<*> | Array<{}> | ThunkAction) => any; // Need to refer to ThunkAction
/* eslint-enable */
+5 -6
View File
@@ -1,6 +1,6 @@
{
"name": "lbry",
"version": "0.52.0-rc.7",
"version": "0.52.0-rc.5",
"description": "A browser for the LBRY network, a digital marketplace controlled by its users.",
"keywords": [
"lbry"
@@ -46,7 +46,7 @@
"dependencies": {
"@ungap/from-entries": "^0.2.1",
"auto-launch": "^5.0.5",
"electron-dl": "^3.2.0",
"electron-dl": "^1.11.0",
"electron-log": "^2.2.12",
"electron-notarize": "^1.0.0",
"electron-updater": "^4.2.4",
@@ -56,7 +56,6 @@
"match-sorter": "^6.3.0",
"parse-duration": "^1.0.0",
"proxy-polyfill": "0.1.6",
"re-reselect": "^4.0.0",
"react-datetime-picker": "^3.2.1",
"react-plastic": "^1.1.1",
"react-top-loading-bar": "^2.0.1",
@@ -124,7 +123,7 @@
"dom-scroll-into-view": "^1.2.1",
"dotenv-defaults": "^2.0.1",
"dotenv-webpack": "^1.8.0",
"electron": "11.5.0",
"electron": "9.4.0",
"electron-builder": "^22.9.1",
"electron-devtools-installer": "^3.1.1",
"electron-is-dev": "^0.3.0",
@@ -216,7 +215,7 @@
"unist-util-visit": "^2.0.3",
"uuid": "^8.3.2",
"vast-client": "^3.1.1",
"video.js": "^7.14.3",
"video.js": "^7.13.3",
"videojs-contrib-quality-levels": "^2.0.9",
"videojs-event-tracking": "^1.0.1",
"villain-react": "^1.0.9",
@@ -238,7 +237,7 @@
"yarn": "^1.3"
},
"lbrySettings": {
"lbrynetDaemonVersion": "0.106.0",
"lbrynetDaemonVersion": "0.103.0",
"lbrynetDaemonUrlTemplate": "https://github.com/lbryio/lbry/releases/download/vDAEMONVER/lbrynet-OSNAME.zip",
"lbrynetDaemonDir": "static/daemon",
"lbrynetDaemonFileName": "lbrynet"
-3
View File
@@ -2219,8 +2219,5 @@
"Showing %filtered% results of %total%": "Showing %filtered% results of %total%",
"filtered": "filtered",
"View All Playlists": "View All Playlists",
"Your wallet is not currently using a cloud sync service. You are in control of backing up your wallet.": "Your wallet is not currently using a cloud sync service. You are in control of backing up your wallet.",
"Sending": "Sending",
"You sent %lbc%": "You sent %lbc%",
"--end--": "--end--"
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

+10
View File
@@ -310,18 +310,27 @@ const analytics: Analytics = {
setUser: (userId) => {
if (internalAnalyticsEnabled && userId) {
window._paq.push(['setUserId', String(userId)]);
// @if TARGET='app'
Native.getAppVersionInfo().then(({ localVersion }) => {
sendMatomoEvent('Version', 'Desktop-Version', localVersion);
});
// @endif
}
},
toggleInternal: (enabled: boolean): void => {
// Always collect analytics on lbry.tv
// @if TARGET='app'
internalAnalyticsEnabled = enabled;
window.localStorage.setItem(SHARE_INTERNAL, enabled);
// @endif
},
toggleThirdParty: (enabled: boolean): void => {
// Always collect analytics on lbry.tv
// @if TARGET='app'
// thirdPartyAnalyticsEnabled = enabled;
window.localStorage.setItem(SHARE_THIRD_PARTY, enabled);
// @endif
},
apiLogView: (uri, outpoint, claimId, timeToStart) => {
@@ -338,6 +347,7 @@ const analytics: Analytics = {
claim_id: claimId,
};
// lbry.tv streams from AWS so we don't care about the time to start
if (timeToStart && !IS_WEB) {
params.time_to_start = timeToStart;
}
@@ -4,12 +4,12 @@ import { selectSubscriptions } from 'redux/selectors/subscriptions';
import { withRouter } from 'react-router';
import { makeSelectClaimForUri } from 'redux/selectors/claims';
import { doResolveUris } from 'redux/actions/claims';
import { selectTopLevelCommentsForUri } from 'redux/selectors/comments';
import { makeSelectTopLevelCommentsForUri } from 'redux/selectors/comments';
import ChannelMentionSuggestions from './view';
const select = (state, props) => {
const subscriptionUris = selectSubscriptions(state).map(({ uri }) => uri);
const topLevelComments = selectTopLevelCommentsForUri(state, props.uri);
const topLevelComments = makeSelectTopLevelCommentsForUri(props.uri)(state);
const commentorUris = [];
// Avoid repeated commentors
+2
View File
@@ -78,6 +78,8 @@ export default function ClaimList(props: Props) {
noEmpty,
} = props;
console.log('noempty', noEmpty);
const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey, SORT_NEW);
// Exclude prefix uris in these results variables. We don't want to show
+1 -1
View File
@@ -277,7 +277,7 @@ function ClaimListHeader(props: Props) {
</div>
{expanded && (
<>
<div className={classnames(`claim-search__menus`)}>
<div className={classnames(`card claim-search__menus`)}>
{/* FRESHNESS FIELD */}
{orderParam === CS.ORDER_BY_TOP && (
<div className="claim-search__input-container">
@@ -1,118 +0,0 @@
// @flow
import React from 'react';
import Button from 'component/button';
import * as ICONS from 'constants/icons';
type Props = {
collectionIndex?: number,
editCollection: (string, CollectionEditParams) => void,
listId?: string,
lastCollectionIndex?: number,
claim: ?Claim,
};
function CollectionButtons(props: Props) {
const { collectionIndex, editCollection, listId, lastCollectionIndex, claim } = props;
const [confirmDelete, setConfirmDelete] = React.useState(false);
return (
<div className="collection-preview__edit-buttons">
<div className="collection-preview__edit-group">
<Button
className={'button-collection-manage top-left'}
icon={ICONS.UP_TOP}
disabled={collectionIndex === 0}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
if (editCollection) {
// $FlowFixMe
editCollection(listId, {
order: { from: collectionIndex, to: 0 },
});
}
}}
/>
<Button
className={'button-collection-manage bottom-left'}
icon={ICONS.DOWN_BOTTOM}
disabled={collectionIndex === lastCollectionIndex}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
if (editCollection) {
// $FlowFixMe
editCollection(listId, {
order: { from: collectionIndex, to: lastCollectionIndex },
});
}
}}
/>
</div>
<div className="collection-preview__edit-group">
<Button
className={'button-collection-manage'}
disabled={collectionIndex === 0}
icon={ICONS.UP}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
if (editCollection) {
// $FlowFixMe
editCollection(listId, {
order: { from: collectionIndex, to: Number(collectionIndex) - 1 },
});
}
}}
/>
<Button
className={'button-collection-manage'}
icon={ICONS.DOWN}
disabled={collectionIndex === lastCollectionIndex}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
if (editCollection) {
// $FlowFixMe
editCollection(listId, {
order: { from: collectionIndex, to: Number(collectionIndex + 1) },
});
}
}}
/>
</div>
{!confirmDelete && (
<div className="collection-preview__edit-group collection-preview__delete ">
<Button
className={'button-collection-manage button-collection-delete top-right bottom-right'}
icon={ICONS.DELETE}
onClick={(e) => {
setConfirmDelete(true);
}}
/>
</div>
)}
{confirmDelete && (
<div className="collection-preview__edit-group collection-preview__delete">
<Button
className={'button-collection-manage button-collection-delete-cancel top-right'}
icon={ICONS.REMOVE}
onClick={(e) => {
setConfirmDelete(false);
}}
/>
<Button
className={'button-collection-manage button-collection-delete-confirm bottom-right'}
icon={ICONS.DELETE}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
// $FlowFixMe
if (editCollection) editCollection(listId, { claims: [claim], remove: true });
}}
/>
</div>
)}
</div>
);
}
export default CollectionButtons;
+5 -4
View File
@@ -1,6 +1,6 @@
import { connect } from 'react-redux';
import {
selectClaimForUri,
makeSelectClaimForUri,
makeSelectIsUriResolving,
makeSelectClaimIsMine,
makeSelectClaimIsPending,
@@ -8,7 +8,7 @@ import {
makeSelectReflectingClaimForUri,
makeSelectClaimWasPurchased,
makeSelectTitleForUri,
selectDateForUri,
makeSelectDateForUri,
} from 'redux/selectors/claims';
import { makeSelectStreamingUrlForUri } from 'redux/selectors/file_info';
import {
@@ -30,14 +30,14 @@ import ClaimPreview from './view';
import formatMediaDuration from 'util/formatMediaDuration';
const select = (state, props) => {
const claim = props.uri && selectClaimForUri(state, props.uri);
const claim = props.uri && makeSelectClaimForUri(props.uri)(state);
const media = claim && claim.value && (claim.value.video || claim.value.audio);
const mediaDuration = media && media.duration && formatMediaDuration(media.duration, { screenReader: true });
return {
claim,
mediaDuration,
date: props.uri && selectDateForUri(state, props.uri),
date: props.uri && makeSelectDateForUri(props.uri)(state),
title: props.uri && makeSelectTitleForUri(props.uri)(state),
pending: props.uri && makeSelectClaimIsPending(props.uri)(state),
reflectingProgress: props.uri && makeSelectReflectingClaimForUri(props.uri)(state),
@@ -45,6 +45,7 @@ const select = (state, props) => {
claimIsMine: props.uri && makeSelectClaimIsMine(props.uri)(state),
isResolvingUri: props.uri && makeSelectIsUriResolving(props.uri)(state),
isResolvingRepost: props.uri && makeSelectIsUriResolving(props.repostUrl)(state),
repostClaim: props.uri && makeSelectClaimForUri(props.uri)(state),
nsfw: props.uri && makeSelectClaimIsNsfw(props.uri)(state),
blackListedOutpoints: selectBlackListedOutpoints(state),
filteredOutpoints: selectFilteredOutpoints(state),
+55 -12
View File
@@ -25,7 +25,8 @@ import ClaimMenuList from 'component/claimMenuList';
import ClaimPreviewLoading from './claim-preview-loading';
import ClaimPreviewHidden from './claim-preview-no-mature';
import ClaimPreviewNoContent from './claim-preview-no-content';
import CollectionEditButtons from './collection-buttons';
import Button from 'component/button';
import * as ICONS from 'constants/icons';
import AbandonedChannelPreview from 'component/abandonedChannelPreview';
@@ -150,7 +151,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
} = props;
const isCollection = claim && claim.value_type === 'collection';
const collectionClaimId = isCollection && claim && claim.claim_id;
const listId = collectionId || collectionClaimId || null;
const listId = collectionId || collectionClaimId;
const WrapperElement = wrapperElement || 'li';
const shouldFetch =
claim === undefined || (claim !== null && claim.value_type === 'channel' && isEmpty(claim.meta) && !pending);
@@ -346,18 +347,8 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
'claim-preview--channel': isChannelUri,
'claim-preview--visited': !isChannelUri && !claimIsMine && hasVisitedUri,
'claim-preview--pending': pending,
'claim-preview--collection-mine': isMyCollection && listId && type === 'listview',
})}
>
{isMyCollection && listId && type === 'listview' && (
<CollectionEditButtons
collectionIndex={collectionIndex}
editCollection={editCollection}
listId={listId}
lastCollectionIndex={lastCollectionIndex}
claim={claim}
/>
)}
{isChannelUri && claim ? (
<UriIndicator focusable={false} uri={uri} link>
<ChannelThumbnail uri={uri} small={type === 'inline'} />
@@ -405,6 +396,58 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
{!pending && (
<>
{renderActions && claim && renderActions(claim)}
{Boolean(isMyCollection && listId) && (
<>
<div className="collection-preview__edit-buttons">
<div className="collection-preview__edit-group">
<Button
button="alt"
className={'button-collection-order'}
disabled={collectionIndex === 0}
icon={ICONS.UP}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
if (editCollection) {
// $FlowFixMe
editCollection(listId, {
order: { from: collectionIndex, to: Number(collectionIndex) - 1 },
});
}
}}
/>
<Button
button="alt"
className={'button-collection-order'}
icon={ICONS.DOWN}
disabled={collectionIndex === lastCollectionIndex}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
if (editCollection) {
// $FlowFixMe
editCollection(listId, {
order: { from: collectionIndex, to: Number(collectionIndex + 1) },
});
}
}}
/>
</div>
<div className="collection-preview__edit-group">
<Button
button="alt"
icon={ICONS.DELETE}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
// $FlowFixMe
if (editCollection) editCollection(listId, { claims: [claim], remove: true });
}}
/>
</div>
</div>
</>
)}
{shouldHideActions || renderActions ? null : actions !== undefined ? (
actions
) : (
+2 -2
View File
@@ -6,7 +6,7 @@ import {
makeSelectTitleForUri,
makeSelectChannelForClaimUri,
makeSelectClaimIsNsfw,
selectDateForUri,
makeSelectDateForUri,
} from 'redux/selectors/claims';
import { doFileGet } from 'redux/actions/file';
import { doResolveUri } from 'redux/actions/claims';
@@ -24,7 +24,7 @@ const select = (state, props) => {
return {
claim,
mediaDuration,
date: props.uri && selectDateForUri(state, props.uri),
date: props.uri && makeSelectDateForUri(props.uri)(state),
channel: props.uri && makeSelectChannelForClaimUri(props.uri)(state),
isResolvingUri: props.uri && makeSelectIsUriResolving(props.uri)(state),
thumbnail: props.uri && makeSelectThumbnailForUri(props.uri)(state),
+2 -2
View File
@@ -187,7 +187,7 @@ function ClaimPreviewTile(props: Props) {
<div className="placeholder claim-tile__title" />
<div
className={classnames('claim-tile__info placeholder', {
contains_view_count: shouldShowViewCount,
'contains_view_count': shouldShowViewCount,
})}
/>
</div>
@@ -247,7 +247,7 @@ function ClaimPreviewTile(props: Props) {
<div>
<div
className={classnames('claim-tile__info', {
contains_view_count: shouldShowViewCount,
'contains_view_count': shouldShowViewCount,
})}
>
{isChannel ? (
+2 -2
View File
@@ -1,10 +1,10 @@
import { connect } from 'react-redux';
import { selectTagsForUri } from 'redux/selectors/claims';
import { makeSelectTagsForUri } from 'redux/selectors/claims';
import { selectFollowedTags } from 'redux/selectors/tags';
import ClaimTags from './view';
const select = (state, props) => ({
tags: selectTagsForUri(state, props.uri),
tags: makeSelectTagsForUri(props.uri)(state),
followedTags: selectFollowedTags(state),
});
+1 -21
View File
@@ -22,8 +22,6 @@ type Props = {
collectionId: string,
showInfo: boolean,
setShowInfo: (boolean) => void,
showEdit: boolean,
setShowEdit: (boolean) => void,
collectionHasEdits: boolean,
isBuiltin: boolean,
doToggleShuffleList: (string, boolean) => void,
@@ -46,8 +44,6 @@ function CollectionActions(props: Props) {
doToggleShuffleList,
playNextUri,
firstItem,
showEdit,
setShowEdit,
} = props;
const [doShuffle, setDoShuffle] = React.useState(false);
const { push } = useHistory();
@@ -162,17 +158,6 @@ function CollectionActions(props: Props) {
/>
);
const showEditButton = (
<Button
title={__('Edit')}
className={classnames('button-toggle', {
'button-toggle--active': showEdit,
})}
icon={ICONS.EDIT}
onClick={() => setShowEdit(!showEdit)}
/>
);
if (isMobile) {
return (
<div className="media__actions">
@@ -188,12 +173,7 @@ function CollectionActions(props: Props) {
{lhsSection}
{rhsSection}
</div>
{uri && (
<div className="section">
{infoButton}
{showEditButton}
</div>
)}
{uri && <>{infoButton}</>}
</div>
);
}
+1 -6
View File
@@ -358,12 +358,7 @@ function CollectionForm(props: Props) {
</div>
</TabPanel>
<TabPanel>
<ClaimList
uris={collectionUrls}
collectionId={collectionId}
empty={__('This list has no items.')}
type={'listview'}
/>
<ClaimList uris={collectionUrls} collectionId={collectionId} empty={__('This list has no items.')} />
</TabPanel>
<TabPanel>
<Card
@@ -10,7 +10,7 @@ import { doFetchItemsInCollection } from 'redux/actions/collections';
import CollectionPreviewOverlay from './view';
const select = (state, props) => {
const collectionId = props.collectionId || (props.uri && makeSelectClaimIdForUri(props.uri)(state));
const collectionId = props.collectionId || (props.uri && makeSelectClaimIdForUri(props.uri));
const claim = props.collectionId && makeSelectClaimForClaimId(props.collectionId)(state);
const collectionUri = props.uri || (claim && (claim.canonical_url || claim.permanent_url)) || null;
+1 -1
View File
@@ -24,7 +24,7 @@ import { selectShowMatureContent } from 'redux/selectors/settings';
import CollectionPreviewTile from './view';
const select = (state, props) => {
const collectionId = props.collectionId || (props.uri && makeSelectClaimIdForUri(props.uri)(state));
const collectionId = props.collectionId || (props.uri && makeSelectClaimIdForUri(props.uri));
const claim = props.collectionId && makeSelectClaimForClaimId(props.collectionId)(state);
const collectionUri = props.uri || (claim && (claim.canonical_url || claim.permanent_url)) || null;
+2 -2
View File
@@ -12,7 +12,7 @@ import { doSetPlayingUri } from 'redux/actions/content';
import { selectUserVerifiedEmail } from 'redux/selectors/user';
import {
selectLinkedCommentAncestors,
selectOthersReactsForComment,
makeSelectOthersReactionsForComment,
makeSelectTotalReplyPagesForParentId,
} from 'redux/selectors/comments';
import { selectActiveChannelClaim } from 'redux/selectors/app';
@@ -29,7 +29,7 @@ const select = (state, props) => {
thumbnail: props.authorUri && makeSelectThumbnailForUri(props.authorUri)(state),
channelIsBlocked: props.authorUri && makeSelectChannelIsMuted(props.authorUri)(state),
commentingEnabled: IS_WEB ? Boolean(selectUserVerifiedEmail(state)) : true,
othersReacts: selectOthersReactsForComment(state, reactionKey),
othersReacts: makeSelectOthersReactionsForComment(reactionKey)(state),
activeChannelClaim,
myChannels: selectMyChannelClaims(state),
playingUri: selectPlayingUri(state),
+3 -3
View File
@@ -3,7 +3,7 @@ import Comment from './view';
import { makeSelectClaimIsMine, makeSelectClaimForUri } from 'redux/selectors/claims';
import { doResolveUri } from 'redux/actions/claims';
import { doToast } from 'redux/actions/notifications';
import { selectMyReactsForComment, selectOthersReactsForComment } from 'redux/selectors/comments';
import { makeSelectMyReactionsForComment, makeSelectOthersReactionsForComment } from 'redux/selectors/comments';
import { doCommentReact } from 'redux/actions/comments';
import { selectActiveChannelClaim } from 'redux/selectors/app';
@@ -15,8 +15,8 @@ const select = (state, props) => {
return {
claim: makeSelectClaimForUri(props.uri)(state),
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
myReacts: selectMyReactsForComment(state, reactionKey),
othersReacts: selectOthersReactsForComment(state, reactionKey),
myReacts: makeSelectMyReactionsForComment(reactionKey)(state),
othersReacts: makeSelectOthersReactionsForComment(reactionKey)(state),
activeChannelId,
};
};
+8 -18
View File
@@ -1,5 +1,4 @@
import { connect } from 'react-redux';
import { doResolveUris } from 'redux/actions/claims';
import {
makeSelectClaimForUri,
makeSelectClaimIsMine,
@@ -7,17 +6,17 @@ import {
selectMyChannelClaims,
} from 'redux/selectors/claims';
import {
selectTopLevelCommentsForUri,
makeSelectTopLevelCommentsForUri,
makeSelectTopLevelTotalPagesForUri,
selectIsFetchingComments,
selectIsFetchingCommentsById,
selectIsFetchingReacts,
makeSelectTotalCommentsCountForUri,
selectOthersReacts,
selectMyReacts,
selectOthersReactsById,
selectMyReactionsByCommentId,
makeSelectCommentIdsForUri,
selectSettingsByChannelId,
selectPinnedCommentsForUri,
makeSelectPinnedCommentsForUri,
} from 'redux/selectors/comments';
import { doCommentReset, doCommentList, doCommentById, doCommentReactList } from 'redux/actions/comments';
import { selectActiveChannelClaim } from 'redux/selectors/app';
@@ -25,19 +24,11 @@ import CommentsList from './view';
const select = (state, props) => {
const activeChannelClaim = selectActiveChannelClaim(state);
const topLevelComments = selectTopLevelCommentsForUri(state, props.uri);
const resolvedComments =
topLevelComments && topLevelComments.length > 0
? topLevelComments.filter(({ channel_url }) => makeSelectClaimForUri(channel_url)(state) !== undefined)
: [];
return {
topLevelComments,
resolvedComments,
myChannels: selectMyChannelClaims(state),
allCommentIds: makeSelectCommentIdsForUri(props.uri)(state),
pinnedComments: selectPinnedCommentsForUri(state, props.uri),
pinnedComments: makeSelectPinnedCommentsForUri(props.uri)(state),
topLevelComments: makeSelectTopLevelCommentsForUri(props.uri)(state),
topLevelTotalPages: makeSelectTopLevelTotalPagesForUri(props.uri)(state),
totalComments: makeSelectTotalCommentsCountForUri(props.uri)(state),
claim: makeSelectClaimForUri(props.uri)(state),
@@ -47,8 +38,8 @@ const select = (state, props) => {
isFetchingReacts: selectIsFetchingReacts(state),
fetchingChannels: selectFetchingMyChannels(state),
settingsByChannelId: selectSettingsByChannelId(state),
myReactsByCommentId: selectMyReacts(state),
othersReactsById: selectOthersReacts(state),
myReactsByCommentId: selectMyReactionsByCommentId(state),
othersReactsById: selectOthersReactsById(state),
activeChannelId: activeChannelClaim && activeChannelClaim.claim_id,
};
};
@@ -58,7 +49,6 @@ const perform = (dispatch) => ({
fetchComment: (commentId) => dispatch(doCommentById(commentId)),
fetchReacts: (commentIds) => dispatch(doCommentReactList(commentIds)),
resetComments: (claimId) => dispatch(doCommentReset(claimId)),
doResolveUris: (uris) => dispatch(doResolveUris(uris, true)),
});
export default connect(select, perform)(CommentsList);
+10 -22
View File
@@ -1,27 +1,15 @@
import { connect } from 'react-redux';
import { doResolveUris } from 'redux/actions/claims';
import { makeSelectClaimIsMine, selectMyChannelClaims, makeSelectClaimForUri } from 'redux/selectors/claims';
import { selectIsFetchingCommentsByParentId, selectRepliesForParentId } from 'redux/selectors/comments';
import { makeSelectClaimIsMine, selectMyChannelClaims } from 'redux/selectors/claims';
import { selectIsFetchingCommentsByParentId, makeSelectRepliesForParentId } from 'redux/selectors/comments';
import { selectUserVerifiedEmail } from 'redux/selectors/user';
import CommentsReplies from './view';
const select = (state, props) => {
const fetchedReplies = selectRepliesForParentId(state, props.parentId);
const resolvedReplies =
fetchedReplies && fetchedReplies.length > 0
? fetchedReplies.filter(({ channel_url }) => makeSelectClaimForUri(channel_url)(state) !== undefined)
: [];
const select = (state, props) => ({
fetchedReplies: makeSelectRepliesForParentId(props.parentId)(state),
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
commentingEnabled: IS_WEB ? Boolean(selectUserVerifiedEmail(state)) : true,
myChannels: selectMyChannelClaims(state),
isFetchingByParentId: selectIsFetchingCommentsByParentId(state),
});
return {
fetchedReplies,
resolvedReplies,
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
userCanComment: IS_WEB ? Boolean(selectUserVerifiedEmail(state)) : true,
myChannels: selectMyChannelClaims(state),
isFetchingByParentId: selectIsFetchingCommentsByParentId(state),
};
};
const perform = (dispatch) => ({ doResolveUris: (uris) => dispatch(doResolveUris(uris, true)) });
export default connect(select, perform)(CommentsReplies);
export default connect(select)(CommentsReplies);
+1 -15
View File
@@ -382,21 +382,7 @@ export const icons = {
[ICONS.NO]: buildIcon(
<path d="M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17" />
),
[ICONS.UP]: buildIcon(
<g>
<polyline transform="matrix(1,0,0,-1,0,24.707107)" points="6 9 12 15 18 9" />
</g>
),
[ICONS.UP_TOP]: buildIcon(
<g>
<path d="m6 16 6-6 6 6M6 8h12" />
</g>
),
[ICONS.DOWN_BOTTOM]: buildIcon(
<g>
<path d="m6 8 6 6 6-6M6 16h12" />
</g>
),
[ICONS.UP]: buildIcon(<polyline transform="matrix(1,0,0,-1,0,24.707107)" points="6 9 12 15 18 9" />),
[ICONS.DOWN]: buildIcon(<polyline points="6 9 12 15 18 9" />),
[ICONS.FULLSCREEN]: buildIcon(
<path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3" />
+2 -2
View File
@@ -1,11 +1,11 @@
import { connect } from 'react-redux';
import { selectDateForUri } from 'redux/selectors/claims';
import { makeSelectDateForUri } from 'redux/selectors/claims';
import * as SETTINGS from 'constants/settings';
import { makeSelectClientSetting } from 'redux/selectors/settings';
import DateTime from './view';
const select = (state, props) => ({
date: props.date || selectDateForUri(state, props.uri),
date: props.date || makeSelectDateForUri(props.uri)(state),
clock24h: makeSelectClientSetting(SETTINGS.CLOCK_24H)(state),
});
export default connect(select)(DateTime);
+49
View File
@@ -0,0 +1,49 @@
import { connect } from 'react-redux';
import DownloadProgress from './view';
import { doSetPlayingUri, doStopDownload, doContinueDownloading, doPurchaseUriWrapper } from 'redux/actions/content';
import * as SETTINGS from 'constants/settings';
import { selectFileInfosByOutpoint } from 'redux/selectors/file_info';
import { selectPrimaryUri, selectPlayingUri } from 'redux/selectors/content';
import { makeSelectClientSetting } from 'redux/selectors/settings';
const select = (state) => {
const byOutpoint = selectFileInfosByOutpoint(state);
const runningByOutpoint = [];
const primaryUri = selectPrimaryUri(state);
const playingUri = selectPlayingUri(state);
const uri = playingUri ? playingUri.uri : null;
let primaryOutpoint = null;
let playingOutpoint = null;
for (const key in byOutpoint) {
const item = byOutpoint[key];
if (item && primaryUri && primaryUri.includes(`/${item.claim_name}`)) primaryOutpoint = item.outpoint;
if (item && uri && uri.includes(`/${item.claim_name}`)) playingOutpoint = item.outpoint;
if (item && item.status === 'running') {
runningByOutpoint.push(item);
}
}
return {
byOutpoint: selectFileInfosByOutpoint(state),
primary: {
uri: primaryUri,
outpoint: primaryOutpoint,
},
playing: {
uri,
outpoint: playingOutpoint,
},
currentTheme: makeSelectClientSetting(SETTINGS.THEME)(state),
};
};
const perform = (dispatch) => ({
pause: () => dispatch(doSetPlayingUri({ uri: null })),
doContinueDownloading: (outpoint, force) => dispatch(doContinueDownloading(outpoint, force)),
stopDownload: (outpoint) => dispatch(doStopDownload(outpoint)),
download: (uri) => dispatch(doPurchaseUriWrapper(uri, false, true)),
});
export default connect(select, perform)(DownloadProgress);
+286
View File
@@ -0,0 +1,286 @@
// @flow
import React, { useState, useEffect } from 'react';
import { shell } from 'electron';
import Button from 'component/button';
import * as ICONS from 'constants/icons';
import { buildURI } from 'util/lbryURI';
import { formatBytes } from 'util/format-bytes';
import { areEqual, removeItem } from 'util/array';
import loadingIcon from '../../../static/img/white_loading.gif';
import darkLoadingIcon from '../../../static/img/dark_loading.gif';
import usePersistedState from 'effects/use-persisted-state';
type Props = {
byOutpoint: any,
primary: any,
playing: any,
currentTheme: string,
stopDownload: (outpoint: string) => void,
doContinueDownloading: (outpoint: string, force: boolean) => void,
download: (uri: string) => void,
};
function DownloadProgress({ byOutpoint, primary, playing, currentTheme, stopDownload, doContinueDownloading }: Props) {
const [isShow, setIsShow] = usePersistedState('download-progress', true);
const [downloading, setDownloading] = usePersistedState('download-progress-downloading', []);
const [cancelHash] = useState({});
const [initDownloadingHash] = useState({});
const [prevPlaying, setPrevPlaying] = useState({});
const [prevPrimary, setPrevPrimary] = useState({});
const handleCancel = (hash, value) => {
cancelHash[hash] = value;
};
const handleStopDownload = (outpoint) => {
const updated = [...downloading];
removeItem(updated, outpoint);
setDownloading(updated);
stopDownload(outpoint);
};
const runningByOutpoint = {};
const currentDownloading = [...downloading];
for (const key in byOutpoint) {
const item = byOutpoint[key];
if (item && item.status === 'running') runningByOutpoint[item.outpoint] = item;
}
Object.keys(runningByOutpoint)
.filter((outpoint) => downloading.indexOf(outpoint) === -1)
.map((outpoint) => {
if (primary.outpoint !== outpoint && playing.outpoint !== outpoint) {
currentDownloading.push(outpoint);
}
});
downloading
.filter((outpoint) => (byOutpoint[outpoint] && byOutpoint[outpoint].status !== 'running') || !byOutpoint[outpoint])
.map((outpoint) => {
removeItem(currentDownloading, outpoint);
});
if (!areEqual(downloading, currentDownloading)) setDownloading(currentDownloading);
if (currentDownloading.length === 0) return null;
if (playing.outpoint !== prevPlaying.outpoint) {
if (downloading.includes(prevPlaying.outpoint)) {
setTimeout(() => {
doContinueDownloading(prevPlaying.outpoint, true);
}, 1000);
}
setPrevPlaying(playing);
}
if (primary.outpoint !== prevPrimary.outpoint) {
if (downloading.includes(prevPrimary.outpoint)) {
setTimeout(() => {
doContinueDownloading(prevPrimary.outpoint, true);
}, 1000);
}
setPrevPrimary(primary);
}
currentDownloading.map((outpoint) => {
if (!initDownloadingHash[outpoint]) {
initDownloadingHash[outpoint] = true;
doContinueDownloading(outpoint, false);
}
});
if (!isShow) {
return (
<>
<Button
iconSize={40}
icon={ICONS.DOWNLOAD}
className="download-progress__toggle-button"
onClick={() => setIsShow(true)}
>
<div className="download-progress__current-downloading">
<span className="notification__bubble">
<span className="notification__count">{currentDownloading.length}</span>
</span>
</div>
</Button>
</>
);
}
return (
<div className="download-progress__header">
<Button className="download-progress__top-close-button" onClick={() => setIsShow(false)}>
<div />
</Button>
{currentDownloading.map((outpoint, index) => {
const item = runningByOutpoint[outpoint];
let releaseTime = '';
let isPlaying = false;
if (item.metadata && item.metadata.release_time) {
releaseTime = new Date(parseInt(item.metadata.release_time) * 1000).toISOString().split('T')[0];
}
if (outpoint === primary.outpoint || outpoint === playing.outpoint) {
isPlaying = true;
}
return (
<div key={item.outpoint}>
{index !== 0 && <hr className="download-progress__divider" />}
<DownloadProgressItem
fileName={item.suggested_file_name}
title={item.metadata.title}
releaseTime={releaseTime}
writtenBytes={item.written_bytes}
totalBytes={item.total_bytes}
addedOn={item.added_on}
directory={item.download_directory}
stopDownload={handleStopDownload}
outpoint={item.outpoint}
isCancel={cancelHash[item.outpoint]}
claimID={item.claim_id}
playing={isPlaying}
claimName={item.claim_name}
handleCancel={handleCancel}
currentTheme={currentTheme}
/>
</div>
);
})}
</div>
);
}
type DownloadProgressItemProps = {
fileName: string,
writtenBytes: number,
totalBytes: number,
addedOn: number,
title: string,
releaseTime: string,
directory: string,
outpoint: string,
isCancel: boolean,
claimID: string,
claimName: string,
playing: boolean,
currentTheme: string,
stopDownload: (outpoint: string) => void,
handleCancel: (hash: string, value: boolean) => void,
};
function DownloadProgressItem({
fileName,
writtenBytes,
totalBytes,
addedOn,
title,
releaseTime,
directory,
outpoint,
isCancel,
claimID,
claimName,
playing,
currentTheme,
stopDownload,
handleCancel,
}: DownloadProgressItemProps) {
const processStopDownload = () => {
handleCancel(outpoint, false);
stopDownload(outpoint);
};
const [percent, setPercent] = useState(0);
const [progressText, setProgressText] = useState('');
useEffect(() => {
const updatePercent = ((writtenBytes / totalBytes) * 100).toFixed(0);
setPercent(updatePercent);
let updateText = '';
const downloadSpeed = Math.ceil(writtenBytes / (Date.now() / 1000 - addedOn));
const remainingSecond = Math.ceil((totalBytes - writtenBytes) / downloadSpeed);
const remainingMinutes = Math.floor(remainingSecond / 60);
if (remainingMinutes > 0) {
updateText += __('%remainingMinutes% minutes %remainSecond% seconds remaining', {
remainingMinutes: remainingMinutes,
remainSecond: remainingSecond - 60 * remainingMinutes,
});
} else {
updateText += __('%remainSecond% seconds remaining', { remainSecond: remainingSecond - 60 * remainingMinutes });
}
updateText += ' -- ';
updateText += __('%written% of %total%', {
written: formatBytes(writtenBytes),
total: formatBytes(totalBytes),
});
updateText += ' ';
updateText += __('(%speed%/sec)', {
speed: formatBytes(downloadSpeed),
});
setProgressText(updateText);
}, [writtenBytes, totalBytes, addedOn]);
const openDownloadFolder = () => {
shell.openPath(directory);
};
return (
<div className="download-progress__state-container">
<div className="download-progress__state-bar">
<Button
label={title}
className="download-progress__state-filename"
navigate={buildURI({ claimName, claimID })}
/>
{playing ? (
currentTheme === 'light' ? (
<img src={loadingIcon} className="download-progress__playing-button" />
) : (
<img src={darkLoadingIcon} className="download-progress__playing-button" />
)
) : (
<div
className="download-progress__close-button"
onClick={() => {
handleCancel(outpoint, true);
}}
>
&times;
</div>
)}
</div>
<div className="download-progress__state-bar">
<a className="download-progress__state-filename-link" onClick={openDownloadFolder}>
{fileName}
</a>
<p className="download-progress__release-time">{releaseTime}</p>
</div>
<div className="download-progress__state-bar">
<div className="download-progress__bar-container">
<div className="download-progress__bar-content" style={{ width: `${percent}%` }} />
</div>
</div>
<p className="download-progress__count-time">{progressText}</p>
{isCancel && (
<div className="download-progress__cancel">
<p>{__('Do you cancel download this file?')}</p>
<div className="download-progress__cancel-confirm">
<Button label={__('Yes')} className="download-progress__cancel-ok" onClick={processStopDownload} />
<Button
label={__('No')}
className="download-progress__cancel-ok"
onClick={() => handleCancel(outpoint, false)}
/>
</div>
</div>
)}
</div>
);
}
export default DownloadProgress;
+1 -1
View File
@@ -27,7 +27,7 @@ function FileDescription(props: Props) {
const { uri, claim, metadata, pendingAmount, doOpenModal, claimIsMine, expandOverride } = props;
const [expanded, setExpanded] = React.useState(false);
const [showCreditDetails, setShowCreditDetails] = React.useState(false);
const amount = claim ? parseFloat(claim.amount) + parseFloat(pendingAmount || claim.meta.support_amount) : undefined;
const amount = parseFloat(claim.amount) + parseFloat(pendingAmount || claim.meta.support_amount);
const formattedAmount = formatCredits(amount, 2, true);
const hasSupport = claim && claim.meta && claim.meta.support_amount && Number(claim.meta.support_amount) > 0;
+26 -1
View File
@@ -1,7 +1,9 @@
// @flow
import React from 'react';
import FileDownloadLink from 'component/fileDownloadLink';
import * as RENDER_MODES from 'constants/file_render_modes';
import Card from 'component/common/card';
import Button from 'component/button';
type Props = {
uri: string,
@@ -9,7 +11,30 @@ type Props = {
};
export default function FileRenderDownload(props: Props) {
const { uri } = props;
const { uri, renderMode } = props;
// @if TARGET='web'
if (RENDER_MODES.UNSUPPORTED_IN_THIS_APP.includes(renderMode)) {
return (
<Card
title={__('Download or get the app')}
subtitle={
<p>
{__(
'This content can be downloaded from lbry.tv, but not displayed. It will display in LBRY Desktop, an app for desktop computers.'
)}
</p>
}
actions={
<div className="section__actions">
<FileDownloadLink uri={uri} buttonType="primary" showLabel />
<Button button={'link'} label={__('Get the App')} href="https://lbry.com/get" />
</div>
}
/>
);
}
// @endif
return <Card title={__('Download')} actions={<FileDownloadLink uri={uri} buttonType="primary" showLabel />} />;
}
+98 -104
View File
@@ -19,64 +19,9 @@ import { isURIEqual } from 'util/lbryURI';
import AutoplayCountdown from 'component/autoplayCountdown';
const IS_DESKTOP_MAC = typeof process === 'object' ? process.platform === 'darwin' : false;
const DEBOUNCE_WINDOW_RESIZE_HANDLER_MS = 100;
const DEBOUNCE_WINDOW_RESIZE_HANDLER_MS = 60;
export const INLINE_PLAYER_WRAPPER_CLASS = 'inline-player__wrapper';
function getScreenWidth() {
if (document && document.documentElement) {
return document.documentElement.clientWidth;
} else {
return window.innerWidth;
}
}
function getScreenHeight() {
if (document && document.documentElement) {
return document.documentElement.clientHeight;
} else {
return window.innerHeight;
}
}
function getFloatingPlayerRect() {
// TODO: use 'fileViewerRect'?
const FLOATING_PLAYER_CLASS = 'content__viewer--floating';
const elem = document.querySelector(`.${FLOATING_PLAYER_CLASS}`);
if (elem) {
return elem.getBoundingClientRect();
} else {
return null;
}
}
function clampRectToScreen(x, y, rect) {
if (rect) {
const ESTIMATED_SCROLL_BAR_PX = 50;
const screenW = getScreenWidth();
const screenH = getScreenHeight();
if (x + rect.width > screenW - ESTIMATED_SCROLL_BAR_PX) {
x = screenW - rect.width - ESTIMATED_SCROLL_BAR_PX;
}
if (y + rect.height > screenH) {
y = screenH - rect.height;
}
}
return { x, y };
}
function calculateRelativePos(x, y) {
return {
x: x / getScreenWidth(),
y: y / getScreenHeight(),
};
}
// ****************************************************************************
// ****************************************************************************
type Props = {
isFloating: boolean,
fileInfo: FileListItem,
@@ -140,7 +85,10 @@ export default function FileRenderFloating(props: Props) {
x: -25,
y: window.innerHeight - 400,
});
const relativePosRef = React.useRef({ x: 0, y: 0 });
const [relativePos, setRelativePos] = useState({
x: 0,
y: 0,
});
const navigateUrl =
playingUri &&
@@ -155,49 +103,93 @@ export default function FileRenderFloating(props: Props) {
? __("It looks like you deleted or moved this file. We're rebuilding it now. It will only take a few seconds.")
: __('Loading');
function restoreToRelativePosition() {
const newX = Math.round(relativePosRef.current.x * getScreenWidth());
const newY = Math.round(relativePosRef.current.y * getScreenHeight());
setPosition(clampRectToScreen(newX, newY, getFloatingPlayerRect()));
function getScreenWidth() {
if (document && document.documentElement) {
return document.documentElement.clientWidth;
} else {
return window.innerWidth;
}
}
const clampToScreenOnResize = React.useCallback(
debounce(() => {
restoreToRelativePosition();
}, DEBOUNCE_WINDOW_RESIZE_HANDLER_MS),
[]
);
function getScreenHeight() {
if (document && document.documentElement) {
return document.documentElement.clientHeight;
} else {
return window.innerHeight;
}
}
// ???
const clampToScreen = React.useCallback((pos) => {
const ESTIMATED_SCROLL_BAR_PX = 50;
const FLOATING_PLAYER_CLASS = 'content__viewer--floating';
const fpPlayerElem = document.querySelector(`.${FLOATING_PLAYER_CLASS}`);
if (fpPlayerElem) {
if (pos.x + fpPlayerElem.getBoundingClientRect().width > getScreenWidth() - ESTIMATED_SCROLL_BAR_PX) {
pos.x = getScreenWidth() - fpPlayerElem.getBoundingClientRect().width - ESTIMATED_SCROLL_BAR_PX;
}
if (pos.y + fpPlayerElem.getBoundingClientRect().height > getScreenHeight()) {
pos.y = getScreenHeight() - fpPlayerElem.getBoundingClientRect().height;
}
}
}, []);
// Updated 'relativePos' based on persisted 'position':
const stringifiedPosition = JSON.stringify(position);
useEffect(() => {
const jsonPosition = JSON.parse(stringifiedPosition);
setRelativePos({
x: jsonPosition.x / getScreenWidth(),
y: jsonPosition.y / getScreenHeight(),
});
}, [stringifiedPosition]);
// Ensure player is within screen when 'isFloating' changes.
useEffect(() => {
const jsonPosition = JSON.parse(stringifiedPosition);
if (isFloating) {
// When the player begins floating, remove the comment source
// so that it doesn't try to resize again in case of going back
// to the origin's comment section and fail to position correctly
if (isComment && playingUri) clearSecondarySource(playingUri.uri);
}
}, [isFloating, isComment, clearSecondarySource, playingUri]);
// Initial update for relativePosRef:
useEffect(() => {
relativePosRef.current = calculateRelativePos(position.x, position.y);
}, []); // eslint-disable-line react-hooks/exhaustive-deps
// Ensure player is within screen when 'isFloating' changes.
useEffect(() => {
if (isFloating) {
restoreToRelativePosition();
let pos = { x: jsonPosition.x, y: jsonPosition.y };
clampToScreen(pos);
if (pos.x !== position.x || pos.y !== position.y) {
setPosition({ x: pos.x, y: pos.y });
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isFloating]);
}, [
clampToScreen,
clearSecondarySource,
isComment,
isFloating,
playingUri,
position.x,
position.y,
setPosition,
stringifiedPosition,
]);
// Listen to main-window resizing and adjust the fp position accordingly:
useEffect(() => {
if (isFloating) {
window.addEventListener('resize', clampToScreenOnResize);
return () => window.removeEventListener('resize', clampToScreenOnResize);
}
}, [isFloating, clampToScreenOnResize]);
const handleMainWindowResize = debounce(() => {
let newPos = {
x: Math.round(relativePos.x * getScreenWidth()),
y: Math.round(relativePos.y * getScreenHeight()),
};
clampToScreen(newPos);
setPosition({ x: newPos.x, y: newPos.y });
}, DEBOUNCE_WINDOW_RESIZE_HANDLER_MS);
window.addEventListener('resize', handleMainWindowResize);
return () => window.removeEventListener('resize', handleMainWindowResize);
// 'relativePos' is needed in the dependency list to avoid stale closure.
// Otherwise, this could just be changed to a one-time effect.
}, [clampToScreen, relativePos.x, relativePos.y, setPosition]);
const handleResize = React.useCallback(() => {
const element = mainFilePlaying
@@ -303,27 +295,24 @@ export default function FileRenderFloating(props: Props) {
}
function handleDragMove(e, ui) {
setWasDragging(true);
const { x, y } = position;
const newX = ui.x;
const newY = ui.y;
// Mark as dragging if the position changed and we were not dragging before.
if (!wasDragging && (newX !== x || newY !== y)) {
setWasDragging(true);
}
const newX = x + ui.deltaX;
const newY = y + ui.deltaY;
setPosition({
x: newX,
y: newY,
});
}
function handleDragStop(e, ui) {
function handleDragStop(e) {
if (wasDragging) {
// e.stopPropagation();
e.stopPropagation();
setWasDragging(false);
}
let newPos = { x: ui.x, y: ui.y };
if (newPos.x !== position.x || newPos.y !== position.y) {
newPos = clampRectToScreen(newPos.x, newPos.y, getFloatingPlayerRect());
setPosition(newPos);
relativePosRef.current = calculateRelativePos(newPos.x, newPos.y);
setRelativePos({
x: position.x / getScreenWidth(),
y: position.y / getScreenHeight(),
});
}
}
@@ -345,7 +334,6 @@ export default function FileRenderFloating(props: Props) {
'content__viewer--inline': !isFloating,
'content__viewer--secondary': isComment,
'content__viewer--theater-mode': !isFloating && videoTheaterMode,
'content__viewer--disable-click': wasDragging,
})}
style={
!isFloating && fileViewerRect
@@ -375,7 +363,13 @@ export default function FileRenderFloating(props: Props) {
)}
{isReadyToPlay ? (
<FileRender className="draggable" uri={uri} desktopPlayStartTime={desktopPlayStartTime} />
<FileRender
className="draggable"
uri={uri}
// @if TARGET='app'
desktopPlayStartTime={desktopPlayStartTime}
// @endif
/>
) : (
<>
{collectionId && !canViewFile ? (
+2
View File
@@ -5,6 +5,7 @@ import classnames from 'classnames';
import SideNavigation from 'component/sideNavigation';
import SettingsSideNavigation from 'component/settingsSideNavigation';
import Header from 'component/header';
import DownloadProgress from 'component/downloadProgress';
/* @if TARGET='app' */
import StatusBar from 'component/common/status-bar';
/* @endif */
@@ -135,6 +136,7 @@ function Page(props: Props) {
<StatusBar />
{/* @endif */}
</div>
<DownloadProgress />
</Fragment>
);
}
+10 -10
View File
@@ -14,11 +14,11 @@ const LIMITED = 'limited';
const NONE = 'none';
type Props = {
setWelcomeVersion: (number) => void,
setWelcomeVersion: number => void,
signOut: () => void,
setShareDataInternal: (boolean) => void,
setShareDataThirdParty: (boolean) => void,
history: { replace: (string) => void },
setShareDataInternal: boolean => void,
setShareDataThirdParty: boolean => void,
history: { replace: string => void },
authenticated: boolean,
authenticateIfSharingData: () => void,
};
@@ -88,7 +88,7 @@ function PrivacyAgreement(props: Props) {
helper={__(`Sending information to third parties (e.g. Google Analytics or Mixpanel) allows us to use detailed
analytical reports to improve all aspects of LBRY.`)}
checked={share === FREE}
onChange={(e) => setShare(FREE)}
onChange={e => setShare(FREE)}
/>
<FormField
name={'shareWithLBRY'}
@@ -103,7 +103,7 @@ function PrivacyAgreement(props: Props) {
`Sharing information with LBRY, Inc. allows us to report to publishers how their content is doing, as
well as track basic usage and performance. This is the minimum required to earn rewards from LBRY, Inc.`
)}
onChange={(e) => setShare(LIMITED)}
onChange={e => setShare(LIMITED)}
/>
<FormField
disabled={authenticated}
@@ -118,7 +118,7 @@ function PrivacyAgreement(props: Props) {
helper={__(`No information will be sent directly to LBRY, Inc. or third-parties about your usage. Note that as
peer-to-peer software, your IP address and potentially other system information can be sent to other
users, though this information is not stored permanently.`)}
onChange={(e) => setShare(NONE)}
onChange={e => setShare(NONE)}
/>
{authenticated && (
<div className="card--inline section--padded">
@@ -128,7 +128,7 @@ function PrivacyAgreement(props: Props) {
signout_button: <Button button="link" label={__('Sign Out')} onClick={signOut} />,
}}
>
You are signed in and sharing data with your cloud service provider. %signout_button%.
You are signed into lbry.tv which automatically shares data with LBRY inc. %signout_button%.
</I18nMessage>
</p>
</div>
@@ -153,14 +153,14 @@ function PrivacyAgreement(props: Props) {
type="radio"
label={'Yes'}
checked={agree === true}
onChange={(e) => setAgree(e.target.checked)}
onChange={e => setAgree(e.target.checked)}
/>
<FormField
name={'disagreeButton'}
type="radio"
checked={agree === false}
label={__('No')}
onChange={(e) => setAgree(!e.target.checked)}
onChange={e => setAgree(!e.target.checked)}
/>
</fieldset>
</div>
+6
View File
@@ -23,6 +23,7 @@ import SignInVerifyPage from 'page/signInVerify';
import BuyPage from 'page/buy';
import ReceivePage from 'page/receive';
import SendPage from 'page/send';
import SwapPage from 'page/swap';
import WalletPage from 'page/wallet';
// Chunk: none
@@ -33,6 +34,7 @@ import ChannelsFollowingDiscoverPage from 'page/channelsFollowingDiscover';
import ChannelsFollowingPage from 'page/channelsFollowing';
import ChannelsPage from 'page/channels';
import CheckoutPage from 'page/checkoutPage';
import CreatorDashboard from 'page/creatorDashboard';
import DiscoverPage from 'page/discover';
import FileListPublished from 'page/fileListPublished';
@@ -222,7 +224,9 @@ function AppRouter(props: Props) {
return (
<Switch>
{/* @if TARGET='app' */}
{welcomeVersion < WELCOME_VERSION && <Route path="/*" component={Welcome} />}
{/* @endif */}
<Redirect
from={`/$/${PAGES.DEPRECATED__CHANNELS_FOLLOWING_MANAGE}`}
to={`/$/${PAGES.CHANNELS_FOLLOWING_DISCOVER}`}
@@ -260,6 +264,7 @@ function AppRouter(props: Props) {
<Route path={`/$/${PAGES.TOP}`} exact component={TopPage} />
<Route path={`/$/${PAGES.SETTINGS}`} exact component={SettingsPage} />
<Route path={`/$/${PAGES.INVITE}/:referrer`} exact component={InvitedPage} />
<Route path={`/$/${PAGES.CHECKOUT}`} exact component={CheckoutPage} />
<Route path={`/$/${PAGES.REPORT_CONTENT}`} exact component={ReportContentPage} />
<Route {...props} path={`/$/${PAGES.LIST}/:collectionId`} component={CollectionPage} />
@@ -299,6 +304,7 @@ function AppRouter(props: Props) {
<PrivateRoute {...props} path={`/$/${PAGES.BUY}`} component={BuyPage} />
<PrivateRoute {...props} path={`/$/${PAGES.RECEIVE}`} component={ReceivePage} />
<PrivateRoute {...props} path={`/$/${PAGES.SEND}`} component={SendPage} />
<PrivateRoute {...props} path={`/$/${PAGES.SWAP}`} component={SwapPage} />
<PrivateRoute {...props} path={`/$/${PAGES.NOTIFICATIONS}`} component={NotificationsPage} />
<PrivateRoute {...props} path={`/$/${PAGES.AUTH_WALLET_PASSWORD}`} component={SignInWalletPasswordPage} />
<PrivateRoute {...props} path={`/$/${PAGES.SETTINGS_OWN_COMMENTS}`} component={OwnComments} />
+1 -1
View File
@@ -267,7 +267,7 @@ export default function SettingSystem(props: Props) {
subtitle={
<React.Fragment>
{__(
`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 sign in to lbry.tv)`
)}{' '}
<Button button="link" label={__('Learn more')} href="https://lbry.com/privacypolicy" />
</React.Fragment>
+1 -1
View File
@@ -114,7 +114,7 @@ function SettingWalletServer(props: Props) {
type="radio"
name="default_wallet_servers"
checked={!advancedMode}
label={__('Use official LBRY wallet servers')}
label={__('Use official lbry.tv wallet servers')}
onChange={(e) => {
if (e.target.checked) {
doClear();
+3 -3
View File
@@ -10,7 +10,7 @@ import Card from 'component/common/card';
type Props = {
cancelButton: Node,
email: string,
resendVerificationEmail: (string) => void,
resendVerificationEmail: string => void,
checkEmailVerified: () => void,
user: {
has_verified_email: boolean,
@@ -35,12 +35,12 @@ function UserEmail(props: Props) {
return (
<Card
title={__('Cloud Account')}
title={__('lbry.tv Account')}
subtitle={
isVerified
? undefined
: __(
'Connecting with a cloud account will allow you to earn rewards, receive content and security updates, and optionally backup your data.'
'Creating a lbry.tv account will allow you to earn rewards, receive content and security updates, and optionally backup your data.'
)
}
actions={
+16
View File
@@ -38,6 +38,8 @@ function UserEmailNew(props: Props) {
setShareDiagnosticData,
clearEmailEntry,
emailExists,
interestedInYoutubSync,
doToggleInterestedInYoutubeSync,
} = props;
const { share_usage_data: shareUsageData } = daemonSettings;
const { push, location } = useHistory();
@@ -93,7 +95,9 @@ function UserEmailNew(props: Props) {
<div className={classnames('main__sign-up')}>
<Card
title={__('Cloud Connect')}
// @if TARGET='app'
subtitle={__('Connect your wallet to Odysee')}
// @endif
actions={
<div className={classnames({ 'card--disabled': DOMAIN === 'lbry.tv' && IS_WEB })}>
<Form onSubmit={handleSubmit} className="section">
@@ -114,6 +118,17 @@ function UserEmailNew(props: Props) {
onChange={(e) => setPassword(e.target.value)}
/>
{/* @if TARGET='web' */}
<FormField
type="checkbox"
name="youtube_sync_checkbox"
label={__('Sync my YouTube channel')}
checked={interestedInYoutubSync}
onChange={() => doToggleInterestedInYoutubeSync()}
/>
{/* @endif */}
{/* @if TARGET='app' */}
<FormField
type="checkbox"
name="sync_checkbox"
@@ -126,6 +141,7 @@ function UserEmailNew(props: Props) {
checked={formSyncEnabled}
onChange={() => setFormSyncEnabled(!formSyncEnabled)}
/>
{/* @endif */}
{!shareUsageData && !IS_WEB && (
<FormField
+2 -10
View File
@@ -15,7 +15,6 @@ import { addPlayNextButton } from './internal/play-next';
import { addPlayPreviousButton } from './internal/play-previous';
import { useHistory } from 'react-router';
import type { HomepageCat } from 'util/buildHomepage';
import debounce from 'util/debounce';
import { formatLbryUrlForWeb, generateListSearchUrlParams } from 'util/url';
const PLAY_TIMEOUT_ERROR = 'play_timeout_error';
@@ -112,14 +111,6 @@ function VideoViewer(props: Props) {
const [replay, setReplay] = useState(false);
const [videoNode, setVideoNode] = useState();
const updateVolumeState = React.useCallback(
debounce((volume, muted) => {
changeVolume(volume);
changeMute(muted);
}, 500),
[]
);
// force everything to recent when URI changes, can cause weird corner cases otherwise (e.g. navigate while autoplay is true)
useEffect(() => {
if (uri && previousUri && uri !== previousUri) {
@@ -352,7 +343,8 @@ function VideoViewer(props: Props) {
});
player.on('volumechange', () => {
if (player) {
updateVolumeState(player.volume(), player.muted());
changeVolume(player.volume());
changeMute(player.muted());
}
});
player.on('ratechange', () => {
+5 -5
View File
@@ -138,19 +138,19 @@ const WalletBalance = (props: Props) => {
</div>
)}
{/* @if TARGET='app' */}
{hasSynced ? (
<p className="section help">
{__('A backup of your wallet is synced with a cloud service.')}
{__('A backup of your wallet is synced with lbry.tv.')}
<HelpLink href="https://lbry.com/faq/account-sync" />
</p>
) : (
<p className="help">
{__(
'Your wallet is not currently using a cloud sync service. You are in control of backing up your wallet.'
)}
<p className="help--warning">
{__('Your wallet is not currently synced with lbry.tv. You are in control of backing up your wallet.')}
<HelpLink navigate={`/$/${PAGES.BACKUP}`} />
</p>
)}
{/* @endif */}
<div className="section__actions">
<Button button="primary" label={__('Buy')} icon={ICONS.BUY} navigate={`/$/${PAGES.BUY}`} />
<Button button="secondary" label={__('Receive')} icon={ICONS.RECEIVE} navigate={`/$/${PAGES.RECEIVE}`} />
-4
View File
@@ -1,8 +1,4 @@
// @flow
/*
This component is not used at this time.
*/
import React from 'react';
import Button from 'component/button';
import { FormField, Form } from 'component/common/form';
+1 -1
View File
@@ -28,7 +28,7 @@ export const FRESH_DEFAULT = 'default';
export const FRESH_TYPES = [FRESH_DEFAULT, FRESH_DAY, FRESH_WEEK, FRESH_MONTH, FRESH_YEAR, FRESH_ALL];
export const ORDER_BY_TRENDING = 'trending';
export const ORDER_BY_TRENDING_VALUE = ['trending_score']; // was ['trending_group', 'trending_mixed'] - deprecated
export const ORDER_BY_TRENDING_VALUE = ['trending_group', 'trending_mixed'];
export const ORDER_BY_TOP = 'top';
export const ORDER_BY_TOP_VALUE = ['effective_amount'];
export const ORDER_BY_NEW = 'new';
+1 -1
View File
@@ -1,2 +1,2 @@
export const ALREADY_CLAIMED = 'once the invite reward has been claimed the referrer cannot be changed';
export const REFERRER_NOT_FOUND = 'A LBRY account could not be found for the referrer you provided.';
export const REFERRER_NOT_FOUND = 'A lbry.tv account could not be found for the referrer you provided.';
-2
View File
@@ -65,9 +65,7 @@ export const OPTIONS = 'Sliders';
export const YES = 'ThumbsUp';
export const NO = 'ThumbsDown';
export const UP = 'ChevronUp';
export const UP_TOP = 'ChevronUpTop';
export const DOWN = 'ChevronDown';
export const DOWN_BOTTOM = 'ChevronDownBottom';
export const SECURE = 'Lock';
export const MENU = 'Menu';
export const BACKUP = 'Database';
+1 -21
View File
@@ -11,14 +11,7 @@ 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 {
doDaemonReady,
doAutoUpdate,
doOpenModal,
doHideModal,
doToggle3PAnalytics,
doUpdateDownloadProgress,
} from 'redux/actions/app';
import { doDaemonReady, doAutoUpdate, doOpenModal, doHideModal, doToggle3PAnalytics } from 'redux/actions/app';
import { isURIValid } from 'util/lbryURI';
import { setSearchApi } from 'redux/actions/search';
import { doSetLanguage, doFetchLanguage, doUpdateIsNightAsync } from 'redux/actions/settings';
@@ -114,19 +107,6 @@ ipcRenderer.on('open-uri-requested', (event, url, newSession) => {
handleError();
});
ipcRenderer.on('download-progress-update', (e, p) => {
app.store.dispatch(doUpdateDownloadProgress(Math.round(p.percent * 100)));
});
ipcRenderer.on('download-update-complete', (e, c) => {
app.store.dispatch({
type: ACTIONS.UPGRADE_DOWNLOAD_COMPLETED,
data: {
path: c.path,
},
});
});
ipcRenderer.on('language-set', (event, language) => {
app.store.dispatch(doSetLanguage(language));
});
+1 -1
View File
@@ -66,7 +66,7 @@ class ModalSetReferrer extends React.PureComponent<Props, State> {
title={__('Enter inviter')}
subtitle={
<React.Fragment>
{__('Did someone invite you to use LBRY? Tell us who and you both get a reward!')}
{__('Did someone invite you to use lbry.tv? Tell us who and you both get a reward!')}
<HelpLink href="https://lbry.com/faq/referrals" />
</React.Fragment>
}
+118 -87
View File
@@ -1,4 +1,5 @@
// @flow
import * as ICONS from 'constants/icons';
import React from 'react';
import Page from 'component/page';
import Card from 'component/common/card';
@@ -13,6 +14,8 @@ import Button from 'component/button';
import Nag from 'component/common/nag';
import I18nMessage from 'component/i18nMessage';
import LbcSymbol from 'component/common/lbc-symbol';
import classnames from 'classnames';
import WalletSwap from 'component/walletSwap';
const MOONPAY_KEY = process.env.MOONPAY_SECRET_KEY;
const COUNTRIES = Array.from(
@@ -34,6 +37,11 @@ const COUNTRIES = Array.from(
)
);
const TAB = {
BUY: 'BUY',
SWAP: 'SWAP',
};
type Props = {
receiveAddress: ?string,
gettingNewAddress: boolean,
@@ -46,6 +54,7 @@ type Props = {
export default function BuyPage(props: Props) {
const { receiveAddress, gettingNewAddress, doGetNewAddress, email, user, doUserSetCountry } = props;
const initialCountry = (user && user.country) || '';
const [tab, setTab] = React.useState(TAB.BUY);
const [url, setUrl] = React.useState();
const [country, setCountry] = React.useState(initialCountry);
const [showPurchaseScreen, setShowPurchaseScreen] = React.useState(false);
@@ -98,99 +107,121 @@ export default function BuyPage(props: Props) {
className="main--swap"
backout={{
backoutLabel: __('Done'),
title: <LbcSymbol prefix={__('Buy')} size={28} />,
title: <LbcSymbol prefix={__('Buy or Swap')} size={28} />,
}}
>
<div className="section">
<>
{!user && (
<div className="main--empty">
<Spinner delayed />
</div>
)}
<Button
key="tip"
icon={ICONS.BUY}
label={__('Buy')}
button="alt"
onClick={() => setTab(TAB.BUY)}
className={classnames('button-toggle', { 'button-toggle--active': tab === TAB.BUY })}
/>
<Button
key="boost"
icon={ICONS.COIN_SWAP}
label={__('Swap')}
button="alt"
onClick={() => setTab(TAB.SWAP)}
className={classnames('button-toggle', { 'button-toggle--active': tab === TAB.SWAP })}
/>
</div>
<div className="section">
{tab === TAB.SWAP && <WalletSwap />}
{tab === TAB.BUY && (
<>
{!user && (
<div className="main--empty">
<Spinner delayed />
</div>
)}
{user && (
<>
{showPurchaseScreen ? (
<Card
title={title}
subtitle={subtitle}
actions={
url ? (
<iframe
allow="accelerometer; autoplay; camera; gyroscope; payment"
frameBorder="0"
src={url}
width="100%"
>
<p>{__('Your browser does not support iframes.')}</p>
</iframe>
) : (
<div className="main--empty">
<Spinner delayed />
</div>
)
}
/>
) : (
<Card
title={title}
subtitle={subtitle}
nag={
country && !isValid && <Nag relative type="helpful" message={"This country isn't supported yet."} />
}
actions={
<div>
<div className="section">
<FormField
label={__('Country')}
type="select"
name="country-codes"
helper={__(
'Only some countries are eligible at this time. We are working to make this available to everyone.'
)}
value={country}
onChange={(e) => setCountry(e.target.value)}
{user && (
<>
{showPurchaseScreen ? (
<Card
title={title}
subtitle={subtitle}
actions={
url ? (
<iframe
allow="accelerometer; autoplay; camera; gyroscope; payment"
frameBorder="0"
src={url}
width="100%"
>
<option value="" disabled defaultValue>
{__('Select your country')}
</option>
{COUNTRIES.map((country, index) => (
<option key={country} value={country}>
{country}
</option>
))}
</FormField>
</div>
{country && (
<div className="section">
{isValid ? (
<div className="section__actions">
<Button
button="primary"
label={__('Continue')}
onClick={() => setShowPurchaseScreen(true)}
/>
</div>
) : (
<div className="section__actions">
<Button button="alt" label={__('Go Back')} onClick={() => goBack()} />
<Button
button="link"
label={__('Try Anyway')}
onClick={() => setShowPurchaseScreen(true)}
/>
</div>
)}
<p>{__('Your browser does not support iframes.')}</p>
</iframe>
) : (
<div className="main--empty">
<Spinner delayed />
</div>
)}
</div>
}
/>
)}
</>
)}
</>
)
}
/>
) : (
<Card
title={title}
subtitle={subtitle}
nag={
country &&
!isValid && <Nag relative type="helpful" message={"This country isn't supported yet."} />
}
actions={
<div>
<div className="section">
<FormField
label={__('Country')}
type="select"
name="country-codes"
helper={__(
'Only some countries are eligible at this time. We are working to make this available to everyone.'
)}
value={country}
onChange={(e) => setCountry(e.target.value)}
>
<option value="" disabled defaultValue>
{__('Select your country')}
</option>
{COUNTRIES.map((country, index) => (
<option key={country} value={country}>
{country}
</option>
))}
</FormField>
</div>
{country && (
<div className="section">
{isValid ? (
<div className="section__actions">
<Button
button="primary"
label={__('Continue')}
onClick={() => setShowPurchaseScreen(true)}
/>
</div>
) : (
<div className="section__actions">
<Button button="alt" label={__('Go Back')} onClick={() => goBack()} />
<Button
button="link"
label={__('Try Anyway')}
onClick={() => setShowPurchaseScreen(true)}
/>
</div>
)}
</div>
)}
</div>
}
/>
)}
</>
)}
</>
)}
</div>
</Page>
);
+2 -2
View File
@@ -49,7 +49,7 @@ function ChannelsFollowingDiscover(props: Props) {
options: {
pageSize: 12,
claimType: 'channel',
orderBy: CS.ORDER_BY_TOP_VALUE,
orderBy: ['effective_amount'],
},
});
@@ -59,7 +59,7 @@ function ChannelsFollowingDiscover(props: Props) {
options: {
pageSize: 8,
claimType: 'channel',
orderBy: CS.ORDER_BY_TRENDING_VALUE,
orderBy: ['trending_group', 'trending_mixed'],
},
});
Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

+2
View File
@@ -0,0 +1,2 @@
import CheckoutPage from './view';
export default CheckoutPage;
+32
View File
@@ -0,0 +1,32 @@
// @flow
import * as React from 'react';
import Page from 'component/page';
import Button from 'component/button';
import Card from 'component/common/card';
import CreditCards from './credit-card-logos.png';
export default function CheckoutPage() {
return (
<Page authPage>
<Card
title={__('Checkout')}
subtitle={__('Your cart contains 1 item.')}
body={
<div className="card--inline card--section card--highlighted">
<strong>{__('lbry.tv Premium - 1 month')}</strong>
<div>$5 per month</div>
</div>
}
actions={
<div className="section__actions">
<Button button="primary" label={__('Checkout')} />
<div>
<img src={CreditCards} style={{ height: '1.5rem' }} />
</div>
<div className="help">We will refund no questions asked within 30 days.</div>
</div>
}
/>
</Page>
);
}
+1 -4
View File
@@ -62,7 +62,6 @@ export default function CollectionPage(props: Props) {
const [didTryResolve, setDidTryResolve] = React.useState(false);
const [showInfo, setShowInfo] = React.useState(false);
const [showEdit, setShowEdit] = React.useState(false);
const { name, totalItems } = collection || {};
const isBuiltin = COLLECTIONS_CONSTS.BUILTIN_LISTS.includes(collectionId);
@@ -134,8 +133,6 @@ export default function CollectionPage(props: Props) {
showInfo={showInfo}
isBuiltin={isBuiltin}
collectionUrls={collectionUrls}
setShowEdit={setShowEdit}
showEdit={showEdit}
/>
}
actions={
@@ -191,7 +188,7 @@ export default function CollectionPage(props: Props) {
<Page>
<div className={classnames('section card-stack')}>
{info}
<ClaimList uris={collectionUrls} collectionId={collectionId} type={showEdit ? 'listview' : undefined} />
<ClaimList uris={collectionUrls} collectionId={collectionId} />
</div>
</Page>
);
+1 -1
View File
@@ -13,7 +13,7 @@ import InvitePage from './view';
const select = (state) => ({
isFailed: selectUserInviteStatusFailed(state),
isPending: selectUserInviteStatusIsPending(state),
inviteAcknowledged: makeSelectClientSetting(SETTINGS.INVITE_ACKNOWLEDGED)(state),
inviteAcknowledged: makeSelectClientSetting(state)(SETTINGS.INVITE_ACKNOWLEDGED),
authenticated: selectUserVerifiedEmail(state),
});
+2 -2
View File
@@ -3,7 +3,7 @@ import { doCommentListOwn, doCommentReset } from 'redux/actions/comments';
import { selectActiveChannelClaim } from 'redux/selectors/app';
import {
selectIsFetchingComments,
selectCommentsForUri,
makeSelectCommentsForUri,
makeSelectTotalCommentsCountForUri,
makeSelectTopLevelTotalPagesForUri,
} from 'redux/selectors/comments';
@@ -17,7 +17,7 @@ const select = (state) => {
return {
activeChannelClaim,
allComments: selectCommentsForUri(state, uri),
allComments: makeSelectCommentsForUri(uri)(state),
totalComments: makeSelectTotalCommentsCountForUri(uri)(state),
topLevelTotalPages: makeSelectTopLevelTotalPagesForUri(uri)(state),
isFetchingComments: selectIsFetchingComments(state),
+6
View File
@@ -0,0 +1,6 @@
import { connect } from 'react-redux';
import SwapPage from './view';
const select = (state) => ({});
export default connect(select, null)(SwapPage);
+21
View File
@@ -0,0 +1,21 @@
// @flow
import React from 'react';
import Page from 'component/page';
import WalletSwap from 'component/walletSwap';
type Props = {};
export default function SwapPage(props: Props) {
return (
<Page
noSideNavigation
className="main--swap"
backout={{
backoutLabel: __('Done'),
title: __('Swap Crypto'),
}}
>
<WalletSwap />
</Page>
);
}
-2
View File
@@ -3,7 +3,6 @@ import React from 'react';
import { useHistory } from 'react-router';
import TxoList from 'component/txoList';
import Page from 'component/page';
import WalletBalance from 'component/walletBalance';
import Spinner from 'component/spinner';
import YrblWalletEmpty from 'component/yrblWalletEmpty';
@@ -35,7 +34,6 @@ const WalletPage = (props: Props) => {
<YrblWalletEmpty includeWalletLink />
) : (
<div className="card-stack">
<WalletBalance />
<TxoList search={search} />
</div>
)}
+39 -4
View File
@@ -1,6 +1,9 @@
// @if TARGET='app'
import { execSync } from 'child_process';
import isDev from 'electron-is-dev';
import { ipcRenderer, remote } from 'electron';
// @endif
import path from 'path';
import * as ACTIONS from 'constants/action_types';
import * as MODALS from 'constants/modal_types';
import * as SETTINGS from 'constants/settings';
@@ -30,6 +33,7 @@ import {
selectUpdateUrl,
selectUpgradeDownloadItem,
selectUpgradeDownloadPath,
selectUpgradeFilename,
selectAutoUpdateDeclined,
selectRemoteVersion,
selectUpgradeTimer,
@@ -46,6 +50,12 @@ import { doSignOutCleanup } from 'util/saved-passwords';
import { doNotificationSocketConnect } from 'redux/actions/websocket';
import { stringifyServerParam, shouldSetSetting } from 'util/sync-settings';
// @if TARGET='app'
const { autoUpdater } = remote.require('electron-updater');
const { download } = remote.require('electron-dl');
const Fs = remote.require('fs');
// @endif
const CHECK_UPGRADE_INTERVAL = 10 * 60 * 1000;
export function doOpenModal(id, modalProps = {}) {
@@ -90,14 +100,38 @@ export function doStartUpgrade() {
export function doDownloadUpgrade() {
return (dispatch, getState) => {
// @if TARGET='app'
const state = getState();
const url = selectUpdateUrl(state);
ipcRenderer.send('download-upgrade', { url, options: {} });
// Make a new directory within temp directory so the filename is guaranteed to be available
const dir = Fs.mkdtempSync(remote.app.getPath('temp') + path.sep);
const upgradeFilename = selectUpgradeFilename(state);
const options = {
onProgress: (p) => dispatch(doUpdateDownloadProgress(Math.round(p * 100))),
directory: dir,
};
download(remote.getCurrentWindow(), selectUpdateUrl(state), options).then((downloadItem) => {
/**
* TODO: get the download path directly from the download object. It should just be
* downloadItem.getSavePath(), but the copy on the main process is being garbage collected
* too soon.
*/
dispatch({
type: ACTIONS.UPGRADE_DOWNLOAD_COMPLETED,
data: {
downloadItem,
path: path.join(dir, upgradeFilename),
},
});
});
dispatch({
type: ACTIONS.UPGRADE_DOWNLOAD_STARTED,
});
dispatch(doHideModal());
dispatch(doOpenModal(MODALS.DOWNLOADING));
// @endif
};
}
@@ -188,7 +222,7 @@ export function doCheckUpgradeAvailable() {
const autoUpdateDeclined = selectAutoUpdateDeclined(state);
if (!autoUpdateDeclined && !isDev) {
ipcRenderer.send('check-for-updates');
autoUpdater.checkForUpdates();
}
return;
}
@@ -632,8 +666,9 @@ export function doGetAndPopulatePreferences() {
export function doHandleSyncComplete(error, hasNewData) {
return (dispatch) => {
if (!error) {
dispatch(doGetAndPopulatePreferences());
if (hasNewData) {
dispatch(doGetAndPopulatePreferences());
// we just got sync data, better update our channels
dispatch(doFetchChannelListMine());
}
+4 -4
View File
@@ -9,8 +9,8 @@ import { selectClaimsByUri, selectMyChannelClaims } from 'redux/selectors/claims
import { doClaimSearch } from 'redux/actions/claims';
import { doToast, doSeeNotifications } from 'redux/actions/notifications';
import {
selectMyReactsForComment,
selectOthersReactsForComment,
makeSelectMyReactionsForComment,
makeSelectOthersReactionsForComment,
selectPendingCommentReacts,
selectModerationBlockList,
selectModerationDelegatorsById,
@@ -466,8 +466,8 @@ export function doCommentReact(commentId: string, type: string) {
}
const reactKey = `${commentId}:${activeChannelClaim.claim_id}`;
const myReacts = selectMyReactsForComment(state, reactKey) || [];
const othersReacts = selectOthersReactsForComment(state, reactKey) || {};
const myReacts = makeSelectMyReactionsForComment(reactKey)(state);
const othersReacts = makeSelectOthersReactionsForComment(reactKey)(state);
const signatureData = await channelSignName(activeChannelClaim.claim_id, activeChannelClaim.name);
if (!signatureData) {
+24 -4
View File
@@ -14,29 +14,30 @@ import {
} from 'redux/selectors/file_info';
import { makeSelectUrlsForCollectionId } from 'redux/selectors/collections';
import { doToast } from 'redux/actions/notifications';
import { doPurchaseUri } from 'redux/actions/file';
import { doPurchaseUri, doDeleteFile } from 'redux/actions/file';
import Lbry from 'lbry';
import * as SETTINGS from 'constants/settings';
import { makeSelectCostInfoForUri, Lbryio } from 'lbryinc';
import { makeSelectClientSetting, selectosNotificationsEnabled, selectDaemonSettings } from 'redux/selectors/settings';
const DOWNLOAD_POLL_INTERVAL = 1000;
var timeOutHash = {};
export function doUpdateLoadStatus(uri: string, outpoint: string) {
export function doUpdateLoadStatus(uri: any, outpoint: string) {
// Updates the loading status for a uri as it's downloading
// Calls file_list and checks the written_bytes value to see if the number has increased
// Not needed on web as users aren't actually downloading the file
// @if TARGET='app'
return (dispatch: Dispatch, getState: GetState) => {
const setNextStatusUpdate = () =>
setTimeout(() => {
(timeOutHash[outpoint] = setTimeout(() => {
// We need to check if outpoint still exists first because user are able to delete file (outpoint) while downloading.
// If a file is already deleted, no point to still try update load status
const byOutpoint = selectFileInfosByOutpoint(getState());
if (byOutpoint[outpoint]) {
dispatch(doUpdateLoadStatus(uri, outpoint));
}
}, DOWNLOAD_POLL_INTERVAL);
}, DOWNLOAD_POLL_INTERVAL));
Lbry.file_list({
outpoint,
@@ -96,6 +97,25 @@ export function doUpdateLoadStatus(uri: string, outpoint: string) {
// @endif
}
export function doContinueDownloading(outpoint: string, force: boolean) {
return (dispatch: Dispatch) => {
if (!timeOutHash[outpoint] || force) {
dispatch(doUpdateLoadStatus(null, outpoint));
}
};
}
export function doStopDownload(outpoint: string) {
return (dispatch: Dispatch) => {
if (timeOutHash[outpoint]) {
clearInterval(timeOutHash[outpoint]);
timeOutHash[outpoint] = undefined;
}
dispatch(doDeleteFile(outpoint, false, false, null));
};
}
export function doSetPrimaryUri(uri: ?string) {
return (dispatch: Dispatch) => {
dispatch({
+3 -10
View File
@@ -4,12 +4,7 @@ import * as SETTINGS from 'constants/settings';
import { Lbryio } from 'lbryinc';
import Lbry from 'lbry';
import { doWalletEncrypt, doWalletDecrypt } from 'redux/actions/wallet';
import {
selectSyncHash,
selectGetSyncIsPending,
selectSetSyncIsPending,
selectSyncIsLocked,
} from 'redux/selectors/sync';
import { selectGetSyncIsPending, selectSetSyncIsPending, selectSyncIsLocked } from 'redux/selectors/sync';
import { makeSelectClientSetting } from 'redux/selectors/settings';
import { getSavedPassword } from 'util/saved-passwords';
import { doAnalyticsTagSync, doHandleSyncComplete } from 'redux/actions/app';
@@ -159,9 +154,7 @@ export function doGetSync(passedPassword?: string, callback?: (any, ?boolean) =>
}
}
return (dispatch: Dispatch, getState: GetState) => {
const state = getState();
const localHash = selectSyncHash(state);
return (dispatch: Dispatch) => {
dispatch({
type: ACTIONS.GET_SYNC_STARTED,
});
@@ -189,7 +182,7 @@ export function doGetSync(passedPassword?: string, callback?: (any, ?boolean) =>
const syncHash = response.hash;
data.syncHash = syncHash;
data.syncData = response.data;
data.changed = response.changed || syncHash !== localHash;
data.changed = response.changed;
data.hasSyncedWallet = true;
if (response.changed) {
-7
View File
@@ -534,7 +534,6 @@ reducers[ACTIONS.ABANDON_CLAIM_SUCCEEDED] = (state: State, action: any): State =
const newMyClaims = state.myClaims ? state.myClaims.slice() : [];
const newMyChannelClaims = state.myChannelClaims ? state.myChannelClaims.slice() : [];
const claimsByUri = Object.assign({}, state.claimsByUri);
const abandoningById = Object.assign({}, state.abandoningById);
const newMyCollectionClaims = state.myCollectionClaims ? state.myCollectionClaims.slice() : [];
Object.keys(claimsByUri).forEach((uri) => {
@@ -542,11 +541,6 @@ reducers[ACTIONS.ABANDON_CLAIM_SUCCEEDED] = (state: State, action: any): State =
delete claimsByUri[uri];
}
});
if (abandoningById[claimId]) {
delete abandoningById[claimId];
}
const myClaims = newMyClaims.filter((i) => i !== claimId);
const myChannelClaims = newMyChannelClaims.filter((i) => i !== claimId);
const myCollectionClaims = newMyCollectionClaims.filter((i) => i !== claimId);
@@ -559,7 +553,6 @@ reducers[ACTIONS.ABANDON_CLAIM_SUCCEEDED] = (state: State, action: any): State =
myCollectionClaims,
byId,
claimsByUri,
abandoningById,
});
};
+1 -12
View File
@@ -65,22 +65,11 @@ export default handleActions(
[ACTIONS.USER_STATE_POPULATE]: (state: TagState, action: { data: { tags: ?Array<string> } }) => {
const { tags } = action.data;
if (Array.isArray(tags)) {
const next = tags && tags.filter((tag) => typeof tag === 'string');
const prev = state.followedTags;
if (next && prev && prev.length === next.length && prev.every((value, index) => value === next[index])) {
// No changes
return state;
}
// New state
return {
...state,
followedTags: next || [],
followedTags: tags,
};
}
// Purge 'followedTags'
return {
...state,
};
+11 -58
View File
@@ -2,22 +2,20 @@
import { normalizeURI, parseURI, isURIValid } from 'util/lbryURI';
import { selectSupportsByOutpoint } from 'redux/selectors/wallet';
import { createSelector } from 'reselect';
import { createCachedSelector } from 're-reselect';
import { isClaimNsfw, filterClaims } from 'util/claim';
import * as CLAIM from 'constants/claim';
type State = { claims: any };
const selectState = (state) => state.claims || {};
export const selectById = (state: State) => selectState(state).byId || {};
export const selectPendingClaimsById = (state: State) => selectState(state).pendingById || {};
export const selectById = createSelector(selectState, (state) => state.byId || {});
export const selectPendingClaimsById = createSelector(selectState, (state) => state.pendingById || {});
export const selectClaimsById = createSelector(selectById, selectPendingClaimsById, (byId, pendingById) => {
return Object.assign(byId, pendingById); // do I need merged to keep metadata?
});
export const selectClaimIdsByUri = (state: State) => selectState(state).claimsByUri || {};
export const selectClaimIdsByUri = createSelector(selectState, (state) => state.claimsByUri || {});
export const selectCurrentChannelPage = createSelector(selectState, (state) => state.currentChannelPage || 1);
@@ -76,43 +74,6 @@ export const selectReflectingById = createSelector(selectState, (state) => state
export const makeSelectClaimForClaimId = (claimId: string) => createSelector(selectClaimsById, (byId) => byId[claimId]);
export const selectClaimForUri = createCachedSelector(
selectClaimIdsByUri,
selectClaimsById,
(state, uri) => uri,
(state, uri, returnRepost = true) => returnRepost,
(byUri, byId, uri, returnRepost) => {
const validUri = isURIValid(uri);
if (validUri && byUri) {
const claimId = uri && byUri[normalizeURI(uri)];
const claim = byId[claimId];
// Make sure to return the claim as is so apps can check if it's been resolved before (null) or still needs to be resolved (undefined)
if (claimId === null) {
return null;
} else if (claimId === undefined) {
return undefined;
}
const repostedClaim = claim && claim.reposted_claim;
if (repostedClaim && returnRepost) {
const channelUrl =
claim.signing_channel && (claim.signing_channel.canonical_url || claim.signing_channel.permanent_url);
return {
...repostedClaim,
repost_url: normalizeURI(uri),
repost_channel_url: channelUrl,
repost_bid_amount: claim && claim.meta && claim.meta.effective_amount,
};
} else {
return claim;
}
}
}
)((state, uri, returnRepost = true) => `${uri}:${returnRepost ? '1' : '0'}`);
export const makeSelectClaimForUri = (uri: string, returnRepost: boolean = true) =>
createSelector(selectClaimIdsByUri, selectClaimsById, (byUri, byId) => {
const validUri = isURIValid(uri);
@@ -176,7 +137,10 @@ export const selectMyActiveClaims = createSelector(
selectMyClaimsRaw,
selectAbandoningIds,
(claims, abandoningIds) =>
new Set(claims && claims.map((claim) => claim.claim_id).filter((claimId) => !abandoningIds.includes(claimId)))
new Set(
claims &&
claims.map((claim) => claim.claim_id).filter((claimId) => Object.keys(abandoningIds).indexOf(claimId) === -1)
)
);
export const makeSelectClaimIsMine = (rawUri: string) => {
@@ -267,11 +231,6 @@ export const makeSelectTotalPagesInChannelSearch = (uri: string) =>
return byChannel['pageCount'];
});
export const selectMetadataForUri = createCachedSelector(selectClaimForUri, (claim, uri) => {
const metadata = claim && claim.value;
return metadata || (claim === undefined ? undefined : null);
})((state, uri) => uri);
export const makeSelectMetadataForUri = (uri: string) =>
createSelector(makeSelectClaimForUri(uri), (claim) => {
const metadata = claim && claim.value;
@@ -286,9 +245,8 @@ export const makeSelectMetadataItemForUri = (uri: string, key: string) =>
export const makeSelectTitleForUri = (uri: string) =>
createSelector(makeSelectMetadataForUri(uri), (metadata) => metadata && metadata.title);
export const selectDateForUri = createCachedSelector(
selectClaimForUri, // input: (state, uri, ?returnRepost)
(claim) => {
export const makeSelectDateForUri = (uri: string) =>
createSelector(makeSelectClaimForUri(uri), (claim) => {
const timestamp =
claim &&
claim.value &&
@@ -302,8 +260,7 @@ export const selectDateForUri = createCachedSelector(
}
const dateObj = new Date(timestamp);
return dateObj;
}
)((state, uri) => uri);
});
export const makeSelectAmountForUri = (uri: string) =>
createSelector(makeSelectClaimForUri(uri), (claim) => {
@@ -539,10 +496,6 @@ export const makeSelectMyChannelPermUrlForName = (name: string) =>
return matchingClaim ? matchingClaim.permanent_url : null;
});
export const selectTagsForUri = createCachedSelector(selectMetadataForUri, (metadata: ?GenericMetadata) => {
return (metadata && metadata.tags) || [];
})((state, uri) => uri);
export const makeSelectTagsForUri = (uri: string) =>
createSelector(makeSelectMetadataForUri(uri), (metadata: ?GenericMetadata) => {
return (metadata && metadata.tags) || [];
+221 -206
View File
@@ -1,79 +1,43 @@
// @flow
import { createSelector } from 'reselect';
import { createCachedSelector } from 're-reselect';
import { selectMutedChannels } from 'redux/selectors/blocked';
import { selectShowMatureContent } from 'redux/selectors/settings';
import { selectBlacklistedOutpointMap, selectFilteredOutpointMap } from 'lbryinc';
import { selectClaimsById, selectMyActiveClaims } from 'redux/selectors/claims';
import { isClaimNsfw } from 'util/claim';
type State = { comments: CommentsState };
const selectState = (state) => state.comments || {};
export const selectCommentsById = (state: State) => selectState(state).commentById || {};
export const selectIsFetchingComments = (state: State) => selectState(state).isLoading;
export const selectIsFetchingCommentsById = (state: State) => selectState(state).isLoadingById;
export const selectIsFetchingCommentsByParentId = (state: State) => selectState(state).isLoadingByParentId;
export const selectIsFetchingReacts = (state: State) => selectState(state).isFetchingReacts;
export const selectCommentsById = createSelector(selectState, (state) => state.commentById || {});
export const selectIsFetchingComments = createSelector(selectState, (state) => state.isLoading);
export const selectIsFetchingCommentsById = createSelector(selectState, (state) => state.isLoadingById);
export const selectIsFetchingCommentsByParentId = createSelector(selectState, (state) => state.isLoadingByParentId);
export const selectIsFetchingReacts = createSelector(selectState, (state) => state.isFetchingReacts);
export const selectOthersReactsById = createSelector(selectState, (state) => state.othersReactsByCommentId);
export const selectMyReacts = (state: State) => state.comments.myReactsByCommentId;
export const selectMyReactsForComment = (state: State, commentIdChannelId: string) => {
// @commentIdChannelId: Format = 'commentId:MyChannelId'
return state.comments.myReactsByCommentId && state.comments.myReactsByCommentId[commentIdChannelId];
};
export const selectPinnedCommentsById = createSelector(selectState, (state) => state.pinnedCommentsById);
export const makeSelectPinnedCommentsForUri = (uri: string) =>
createSelector(
selectCommentsByUri,
selectCommentsById,
selectPinnedCommentsById,
(byUri, byId, pinnedCommentsById) => {
const claimId = byUri[uri];
const pinnedCommentIds = pinnedCommentsById && pinnedCommentsById[claimId];
const pinnedComments = [];
export const selectOthersReacts = (state: State) => state.comments.othersReactsByCommentId;
export const selectOthersReactsForComment = (state: State, id: string) => {
return state.comments.othersReactsByCommentId && state.comments.othersReactsByCommentId[id];
};
if (pinnedCommentIds) {
pinnedCommentIds.forEach((commentId) => {
pinnedComments.push(byId[commentId]);
});
}
// previously this used a mapping from claimId -> Array<Comments>
/* export const selectCommentsById = createSelector(
selectState,
state => state.byId || {}
); */
export const selectCommentsByUri = createSelector(selectState, (state) => {
const byUri = state.commentsByUri || {};
const comments = {};
Object.keys(byUri).forEach((uri) => {
const claimId = byUri[uri];
if (claimId === null) {
comments[uri] = null;
} else {
comments[uri] = claimId;
return pinnedComments;
}
});
);
return comments;
});
export const selectPinnedCommentsById = (state: State) => selectState(state).pinnedCommentsById;
export const selectPinnedCommentsForUri = createCachedSelector(
selectCommentsByUri,
selectCommentsById,
selectPinnedCommentsById,
(state, uri) => uri,
(byUri, byId, pinnedCommentsById, uri) => {
const claimId = byUri[uri];
const pinnedCommentIds = pinnedCommentsById && pinnedCommentsById[claimId];
const pinnedComments = [];
if (pinnedCommentIds) {
pinnedCommentIds.forEach((commentId) => {
pinnedComments.push(byId[commentId]);
});
}
return pinnedComments;
}
)((state, uri) => uri);
export const selectModerationBlockList = createSelector(
(state) => selectState(state).moderationBlockList,
(moderationBlockList) => {
return moderationBlockList ? moderationBlockList.reverse() : [];
}
export const selectModerationBlockList = createSelector(selectState, (state) =>
state.moderationBlockList ? state.moderationBlockList.reverse() : []
);
export const selectAdminBlockList = createSelector(selectState, (state) =>
state.adminBlockList ? state.adminBlockList.reverse() : []
@@ -82,19 +46,35 @@ export const selectModeratorBlockList = createSelector(selectState, (state) =>
state.moderatorBlockList ? state.moderatorBlockList.reverse() : []
);
export const selectPersonalTimeoutMap = (state: State) => selectState(state).personalTimeoutMap;
export const selectAdminTimeoutMap = (state: State) => selectState(state).adminTimeoutMap;
export const selectModeratorTimeoutMap = (state: State) => selectState(state).moderatorTimeoutMap;
export const selectModeratorBlockListDelegatorsMap = (state: State) =>
selectState(state).moderatorBlockListDelegatorsMap;
export const selectTogglingForDelegatorMap = (state: State) => selectState(state).togglingForDelegatorMap;
export const selectBlockingByUri = (state: State) => selectState(state).blockingByUri;
export const selectUnBlockingByUri = (state: State) => selectState(state).unBlockingByUri;
export const selectFetchingModerationBlockList = (state: State) => selectState(state).fetchingModerationBlockList;
export const selectModerationDelegatesById = (state: State) => selectState(state).moderationDelegatesById;
export const selectIsFetchingModerationDelegates = (state: State) => selectState(state).fetchingModerationDelegates;
export const selectModerationDelegatorsById = (state: State) => selectState(state).moderationDelegatorsById;
export const selectIsFetchingModerationDelegators = (state: State) => selectState(state).fetchingModerationDelegators;
export const selectPersonalTimeoutMap = createSelector(selectState, (state) => state.personalTimeoutMap);
export const selectAdminTimeoutMap = createSelector(selectState, (state) => state.adminTimeoutMap);
export const selectModeratorTimeoutMap = createSelector(selectState, (state) => state.moderatorTimeoutMap);
export const selectModeratorBlockListDelegatorsMap = createSelector(
selectState,
(state) => state.moderatorBlockListDelegatorsMap
);
export const selectTogglingForDelegatorMap = createSelector(selectState, (state) => state.togglingForDelegatorMap);
export const selectBlockingByUri = createSelector(selectState, (state) => state.blockingByUri);
export const selectUnBlockingByUri = createSelector(selectState, (state) => state.unBlockingByUri);
export const selectFetchingModerationBlockList = createSelector(
selectState,
(state) => state.fetchingModerationBlockList
);
export const selectModerationDelegatesById = createSelector(selectState, (state) => state.moderationDelegatesById);
export const selectIsFetchingModerationDelegates = createSelector(
selectState,
(state) => state.fetchingModerationDelegates
);
export const selectModerationDelegatorsById = createSelector(selectState, (state) => state.moderationDelegatorsById);
export const selectIsFetchingModerationDelegators = createSelector(
selectState,
(state) => state.fetchingModerationDelegators
);
export const selectHasAdminChannel = createSelector(selectState, (state) => {
const myChannelIds = Object.keys(state.moderationDelegatorsById);
@@ -127,29 +107,24 @@ export const selectCommentsByClaimId = createSelector(selectState, selectComment
return comments;
});
// no superchats?
export const selectSuperchatsByUri = (state: State) => selectState(state).superChatsByUri;
export const selectSuperchatsByUri = createSelector(selectState, (state) => state.superChatsByUri);
export const selectTopLevelCommentsByClaimId = createSelector(
(state) => selectState(state).topLevelCommentsById,
selectCommentsById,
(topLevelCommentsById, byId) => {
const byClaimId = topLevelCommentsById || {};
const comments = {};
export const selectTopLevelCommentsByClaimId = createSelector(selectState, selectCommentsById, (state, byId) => {
const byClaimId = state.topLevelCommentsById || {};
const comments = {};
// replace every comment_id in the list with the actual comment object
Object.keys(byClaimId).forEach((claimId) => {
const commentIds = byClaimId[claimId];
// replace every comment_id in the list with the actual comment object
Object.keys(byClaimId).forEach((claimId) => {
const commentIds = byClaimId[claimId];
comments[claimId] = Array(commentIds === null ? 0 : commentIds.length);
for (let i = 0; i < commentIds.length; i++) {
comments[claimId][i] = byId[commentIds[i]];
}
});
comments[claimId] = Array(commentIds === null ? 0 : commentIds.length);
for (let i = 0; i < commentIds.length; i++) {
comments[claimId][i] = byId[commentIds[i]];
}
});
return comments;
}
);
return comments;
});
export const makeSelectCommentForCommentId = (commentId: string) =>
createSelector(selectCommentsById, (comments) => comments[commentId]);
@@ -171,7 +146,27 @@ export const selectRepliesByParentId = createSelector(selectState, selectComment
return comments;
});
export const selectLinkedCommentAncestors = (state: State) => selectState(state).linkedCommentAncestors;
// previously this used a mapping from claimId -> Array<Comments>
/* export const selectCommentsById = createSelector(
selectState,
state => state.byId || {}
); */
export const selectCommentsByUri = createSelector(selectState, (state) => {
const byUri = state.commentsByUri || {};
const comments = {};
Object.keys(byUri).forEach((uri) => {
const claimId = byUri[uri];
if (claimId === null) {
comments[uri] = null;
} else {
comments[uri] = claimId;
}
});
return comments;
});
export const selectLinkedCommentAncestors = createSelector(selectState, (state) => state.linkedCommentAncestors);
export const makeSelectCommentIdsForUri = (uri: string) =>
createSelector(selectState, selectCommentsByUri, selectClaimsById, (state, byUri) => {
@@ -179,48 +174,62 @@ export const makeSelectCommentIdsForUri = (uri: string) =>
return state.byId[claimId];
});
const filterCommentsDepOnList = {
claimsById: selectClaimsById,
myClaims: selectMyActiveClaims,
mutedChannels: selectMutedChannels,
personalBlockList: selectModerationBlockList,
blacklistedMap: selectBlacklistedOutpointMap,
filteredMap: selectFilteredOutpointMap,
showMatureContent: selectShowMatureContent,
};
export const selectMyReactionsByCommentId = createSelector(selectState, (state) => state.myReactsByCommentId);
const filterCommentsPropKeys = Object.keys(filterCommentsDepOnList);
/**
* makeSelectMyReactionsForComment
*
* @param commentIdChannelId Format = "commentId:MyChannelId".
*/
export const makeSelectMyReactionsForComment = (commentIdChannelId: string) =>
createSelector(selectState, (state) => {
if (!state.myReactsByCommentId) {
return [];
}
export const selectPendingCommentReacts = (state: State) => selectState(state).pendingCommentReactions;
export const selectSettingsByChannelId = (state: State) => selectState(state).settingsByChannelId;
export const selectFetchingCreatorSettings = (state: State) => selectState(state).fetchingSettings;
export const selectFetchingBlockedWords = (state: State) => selectState(state).fetchingBlockedWords;
return state.myReactsByCommentId[commentIdChannelId] || [];
});
export const selectCommentsForUri = createCachedSelector(
(state, uri) => uri,
selectCommentsByClaimId,
selectCommentsByUri,
...Object.values(filterCommentsDepOnList),
(uri, byClaimId, byUri, ...filterInputs) => {
const claimId = byUri[uri];
const comments = byClaimId && byClaimId[claimId];
return filterComments(comments, claimId, filterInputs);
}
)((state, uri) => uri);
export const makeSelectOthersReactionsForComment = (commentId: string) =>
createSelector(selectState, (state) => {
if (!state.othersReactsByCommentId) {
return {};
}
export const selectTopLevelCommentsForUri = createCachedSelector(
(state, uri) => uri,
(state, uri, maxCount) => maxCount,
selectTopLevelCommentsByClaimId,
selectCommentsByUri,
...Object.values(filterCommentsDepOnList),
(uri, maxCount = -1, byClaimId, byUri, ...filterInputs) => {
const claimId = byUri[uri];
const comments = byClaimId && byClaimId[claimId];
const filtered = filterComments(comments, claimId, filterInputs);
return maxCount > 0 ? filtered.slice(0, maxCount) : filtered;
}
)((state, uri, maxCount = -1) => `${uri}:${maxCount}`);
return state.othersReactsByCommentId[commentId] || {};
});
export const selectPendingCommentReacts = createSelector(selectState, (state) => state.pendingCommentReactions);
export const selectSettingsByChannelId = createSelector(selectState, (state) => state.settingsByChannelId);
export const selectFetchingCreatorSettings = createSelector(selectState, (state) => state.fetchingSettings);
export const selectFetchingBlockedWords = createSelector(selectState, (state) => state.fetchingBlockedWords);
export const makeSelectCommentsForUri = (uri: string) =>
createSelector(
(state) => state,
selectCommentsByClaimId,
selectCommentsByUri,
(state, byClaimId, byUri) => {
const claimId = byUri[uri];
const comments = byClaimId && byClaimId[claimId];
return makeSelectFilteredComments(comments, claimId)(state);
}
);
export const makeSelectTopLevelCommentsForUri = (uri: string) =>
createSelector(
(state) => state,
selectTopLevelCommentsByClaimId,
selectCommentsByUri,
(state, byClaimId, byUri) => {
const claimId = byUri[uri];
const comments = byClaimId && byClaimId[claimId];
return makeSelectFilteredComments(comments, claimId)(state);
}
);
export const makeSelectTopLevelTotalCommentsForUri = (uri: string) =>
createSelector(selectState, selectCommentsByUri, (state, byUri) => {
@@ -234,93 +243,99 @@ export const makeSelectTopLevelTotalPagesForUri = (uri: string) =>
return state.topLevelTotalPagesById[claimId] || 0;
});
export const selectRepliesForParentId = createCachedSelector(
(state, id) => id,
(state) => selectState(state).repliesByParentId,
selectCommentsById,
...Object.values(filterCommentsDepOnList),
(id, repliesByParentId, commentsById, ...filterInputs) => {
// const claimId = byUri[uri]; // just parentId (id)
const replyIdsForParent = repliesByParentId[id] || [];
if (!replyIdsForParent.length) return null;
export const makeSelectRepliesForParentId = (id: string) =>
createSelector(
(state) => state,
selectCommentsById,
(state, commentsById) => {
// const claimId = byUri[uri]; // just parentId (id)
const replyIdsByParentId = state.comments.repliesByParentId;
const replyIdsForParent = replyIdsByParentId[id] || [];
if (!replyIdsForParent.length) return null;
const comments = [];
replyIdsForParent.forEach((cid) => {
comments.push(commentsById[cid]);
});
// const comments = byParentId && byParentId[id];
const comments = [];
replyIdsForParent.forEach((cid) => {
comments.push(commentsById[cid]);
});
// const comments = byParentId && byParentId[id];
return filterComments(comments, undefined, filterInputs);
}
)((state, id: string) => id);
return makeSelectFilteredComments(comments)(state);
}
);
/**
* filterComments
* makeSelectFilteredComments
*
* @param comments List of comments to filter.
* @param claimId The claim that `comments` reside in.
* @oaram filterInputs Values returned by filterCommentsDepOnList.
*/
const filterComments = (comments: Array<Comment>, claimId?: string, filterInputs: any) => {
const filterProps = filterInputs.reduce(function (acc, cur, i) {
acc[filterCommentsPropKeys[i]] = cur;
return acc;
}, {});
const {
claimsById,
myClaims,
mutedChannels,
personalBlockList,
blacklistedMap,
filteredMap,
showMatureContent,
} = filterProps;
return comments
? comments.filter((comment) => {
if (!comment) {
// It may have been recently deleted after being blocked
return false;
}
const channelClaim = claimsById[comment.channel_id];
// Return comment if `channelClaim` doesn't exist so the component knows to resolve the author
if (channelClaim) {
if (myClaims && myClaims.size > 0) {
const claimIsMine = channelClaim.is_my_output || myClaims.has(channelClaim.claim_id);
if (claimIsMine) {
return true;
}
}
const outpoint = `${channelClaim.txid}:${channelClaim.nout}`;
if (blacklistedMap[outpoint] || filteredMap[outpoint]) {
return false;
}
if (!showMatureContent) {
const claimIsMature = isClaimNsfw(channelClaim);
if (claimIsMature) {
const makeSelectFilteredComments = (comments: Array<Comment>, claimId?: string) =>
createSelector(
selectClaimsById,
selectMyActiveClaims,
selectMutedChannels,
selectModerationBlockList,
selectAdminBlockList,
selectModeratorBlockList,
selectBlacklistedOutpointMap,
selectFilteredOutpointMap,
selectShowMatureContent,
(
claimsById,
myClaims,
mutedChannels,
personalBlockList,
adminBlockList,
moderatorBlockList,
blacklistedMap,
filteredMap,
showMatureContent
) => {
return comments
? comments.filter((comment) => {
if (!comment) {
// It may have been recently deleted after being blocked
return false;
}
}
}
if (claimId) {
const claimIdIsMine = myClaims && myClaims.size > 0 && myClaims.has(claimId);
if (!claimIdIsMine) {
if (personalBlockList.includes(comment.channel_url)) {
return false;
const channelClaim = claimsById[comment.channel_id];
// Return comment if `channelClaim` doesn't exist so the component knows to resolve the author
if (channelClaim) {
if (myClaims && myClaims.size > 0) {
const claimIsMine = channelClaim.is_my_output || myClaims.has(channelClaim.claim_id);
if (claimIsMine) {
return true;
}
}
const outpoint = `${channelClaim.txid}:${channelClaim.nout}`;
if (blacklistedMap[outpoint] || filteredMap[outpoint]) {
return false;
}
if (!showMatureContent) {
const claimIsMature = isClaimNsfw(channelClaim);
if (claimIsMature) {
return false;
}
}
}
}
}
return !mutedChannels.includes(comment.channel_url);
})
: [];
};
if (claimId) {
const claimIdIsMine = myClaims && myClaims.size > 0 && myClaims.has(claimId);
if (!claimIdIsMine) {
if (personalBlockList.includes(comment.channel_url) || adminBlockList.includes(comment.channel_url)) {
return false;
}
}
}
return !mutedChannels.includes(comment.channel_url);
})
: [];
}
);
export const makeSelectTotalReplyPagesForParentId = (parentId: string) =>
createSelector(selectState, (state) => {
+8 -8
View File
@@ -1,16 +1,16 @@
// @flow
import { createSelector } from 'reselect';
type State = { tags: TagState };
const selectState = (state: State) => state.tags || {};
const selectState = (state: { tags: TagState }) => state.tags || {};
export const selectKnownTagsByName = createSelector(selectState, (state: TagState): KnownTags => state.knownTags);
export const selectFollowedTagsList = (state: State) => selectState(state).followedTags;
export const selectFollowedTagsList = createSelector(selectState, (state: TagState): Array<string> =>
state.followedTags.filter(tag => typeof tag === 'string')
);
export const selectFollowedTags = createSelector(selectFollowedTagsList, (followedTags: Array<string>): Array<Tag> =>
followedTags.map((tag) => ({ name: tag.toLowerCase() })).sort((a, b) => a.name.localeCompare(b.name))
followedTags.map(tag => ({ name: tag.toLowerCase() })).sort((a, b) => a.name.localeCompare(b.name))
);
export const selectUnfollowedTags = createSelector(
@@ -19,7 +19,7 @@ export const selectUnfollowedTags = createSelector(
(tagsByName: KnownTags, followedTags: Array<string>): Array<Tag> => {
const followedTagsSet = new Set(followedTags);
let tagsToReturn = [];
Object.keys(tagsByName).forEach((key) => {
Object.keys(tagsByName).forEach(key => {
if (!followedTagsSet.has(key)) {
const { name } = tagsByName[key];
tagsToReturn.push({ name: name.toLowerCase() });
@@ -31,6 +31,6 @@ export const selectUnfollowedTags = createSelector(
);
export const makeSelectIsFollowingTag = (tag: string) =>
createSelector(selectFollowedTags, (followedTags) => {
return followedTags.some((followedTag) => followedTag.name === tag.toLowerCase());
createSelector(selectFollowedTags, followedTags => {
return followedTags.some(followedTag => followedTag.name === tag.toLowerCase());
});
+1
View File
@@ -66,3 +66,4 @@
@import 'component/empty';
@import 'component/stripe-card';
@import 'component/wallet-tip-send';
@import 'component/download-progress';
+10 -35
View File
@@ -604,55 +604,30 @@ svg + .button__label {
}
}
.button-collection-manage {
.button-collection-order {
height: 100%;
font-size: var(--font-base);
border-left-width: 0;
border-radius: 0;
margin: 0;
width: 100%;
color: var(--color-text);
button {
padding: var(--spacing-xxs);
}
.button__content {
display: unset;
}
line-height: 1.2;
font-weight: var(--font-weight-bold);
height: 100%;
background-color: var(--color-button-alt-bg);
color: var(--color-button-alt-text);
text-align: center;
&:hover {
background-color: var(--color-button-alt-bg-hover);
}
@media (max-width: $breakpoint-small) {
font-size: var(--font-small);
padding: var(--spacing-xs);
}
@media (max-width: $breakpoint-small) {
padding: var(--spacing-s) var(--spacing-s);
}
&.top-right {
border-top-right-radius: var(--border-radius);
}
&.top-left {
&:first-of-type {
border-left-width: 1px;
border-top-left-radius: var(--border-radius);
}
&.bottom-right {
border-bottom-right-radius: var(--border-radius);
}
&.bottom-left {
border-bottom-left-radius: var(--border-radius);
}
&.button-collection-delete-confirm {
background-color: green;
}
&.button-collection-delete-cancel {
background-color: red;
&:last-of-type {
border-top-right-radius: var(--border-radius);
border-bottom-right-radius: var(--border-radius);
}
}
+1 -5
View File
@@ -215,11 +215,6 @@
}
}
.claim-preview--collection-mine {
padding-left: 7rem;
position: relative;
}
.claim-preview--pending {
opacity: 0.6;
}
@@ -725,6 +720,7 @@
margin: 0 0;
padding: var(--spacing-xxs) var(--spacing-xxs);
height: unset;
background-color: var(--color-header-background);
// label (with 'Add' text) hidden by default
.button__label {
+8 -6
View File
@@ -13,8 +13,7 @@
justify-content: flex-start;
align-items: center;
padding: var(--spacing-m);
padding-left: 0;
padding-bottom: 0;
padding-bottom: var(--spacing-s);
margin-top: var(--spacing-m);
margin-bottom: var(--spacing-m);
color: var(--color-text-subtitle);
@@ -42,14 +41,17 @@
flex-direction: column;
font-size: var(--font-body);
width: 100%;
margin-bottom: var(--spacing-m);
&:not(:first-of-type) {
margin-top: var(--spacing-s);
}
@media (min-width: $breakpoint-small) {
width: auto;
margin-top: 0;
&:not(:last-of-type) {
padding-right: var(--spacing-m);
&:not(:first-of-type) {
margin-top: 0;
padding-left: var(--spacing-m);
}
}
}
+13 -18
View File
@@ -86,27 +86,22 @@
}
.collection-preview__edit-buttons {
position: absolute;
left: 0;
top: calc(-1 * var(--spacing-m));
bottom: calc(-1 * var(--spacing-m));
padding-left: 0;
padding-top: var(--spacing-m);
padding-bottom: var(--spacing-m);
display: grid;
grid-template-columns: 1fr 1fr 1fr;
align-items: center;
display: flex;
flex-direction: row;
margin-top: var(--spacing-xs);
margin-bottom: var(--spacing-xs);
}
.collection-preview__edit-group {
height: 100%;
display: flex;
flex-direction: column;
width: 2rem;
align-items: center;
justify-content: center;
align-items: stretch;
flex-grow: 4;
&:not(:last-of-type) {
margin-right: var(--spacing-s);
}
margin-right: var(--spacing-s);
button {
@media (max-width: $breakpoint-small) {
padding: var(--spacing-s) var(--spacing-s);
}
}
}
.collection-edit__header {
+224
View File
@@ -0,0 +1,224 @@
.download-progress__header {
padding: 15px;
position: fixed;
bottom: 0;
right: 0;
width: 400px;
display: flex;
flex-direction: column;
background-color: var(--color-header-background); //var(--color-gray-9):dark-mode
border-radius: var(--border-radius);
// border: 1px solid var(--color-gray-3);
z-index: 9999;
}
.download-progress__top-close-button {
position: absolute;
top: 7px;
right: 15px;
font-size: 35px;
background-color: transparent;
width: 15px;
height: 15px;
div {
height: 2px;
width: 13px;
background-color: var(--color-gray-4);
border-radius: var(--border-radius);
}
}
.download-progress__state-container {
margin-top: 10px;
padding-bottom: 10px;
display: flex;
flex-direction: column;
width: 100%;
}
.download-progress__state-filename {
margin: 0;
font-weight: 800;
font-size: 13px;
flex: 1;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-right: 10px;
span.button__label {
color: var(--color-text);
}
}
.download-progress__state-filename-link {
margin: 0;
font-weight: 800;
font-size: 13px;
flex: 1;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-right: 10px;
text-decoration: underline;
cursor: pointer;
}
.download-progress__release-time {
margin: 0;
font-weight: 800;
font-size: 12px;
margin-left: auto;
font-style: italic;
}
.download-progress__state-bar {
display: flex;
flex-direction: row;
width: 100%;
align-items: center;
margin-bottom: 2px;
}
.download-progress__bar-container {
width: 100%;
background-color: var(--color-gray-5);
height: 6px;
border-radius: var(--border-radius);
}
.download-progress__bar-content {
border-radius: var(--border-radius);
height: 100%;
background-color: var(--color-primary);
}
.download-progress__close-button {
flex-shrink: 0;
margin-left: auto;
font-size: 20px;
cursor: pointer;
}
.download-progress__playing-button {
flex-shrink: 0;
margin-left: auto;
width: 29.6px;
height: 29.6px;
}
.download-progress__count-time {
font-size: 11px;
letter-spacing: -0.6px;
}
.download-progress__divider {
border-top: 1px solid var(--color-gray-6);
margin-left: -15px;
width: 110%;
}
.download-progress__cancel {
margin-top: 7px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.download-progress__cancel p {
margin: 0;
font-size: 12px;
margin: 0;
white-space: nowrap;
width: 285px;
overflow: hidden;
text-overflow: ellipsis;
}
.download-progress__cancel b {
font-size: 13px;
}
.download-progress__cancel-confirm {
width: 90px;
display: flex;
justify-content: space-around;
align-items: center;
}
.download-progress__cancel-ok {
border: none;
background-color: transparent;
font-size: 13px;
color: var(--color-text);
}
.download-progress__cancel-ok:hover {
color: var(--color-primary);
}
.download__container {
position: fixed;
bottom: 10px;
right: 10px;
width: 400px;
height: 300px;
border-radius: var(--border-radius);
box-shadow: 2px 2px 5px var(--color-gray-4);
background-color: var(--color-white);
transition: width 2s;
}
.download-progress__toggle-button {
position: fixed;
bottom: 10px;
right: 10px;
border: none;
background: var(--color-header-background);
color: var(--color-gray-6);
width: 50px;
height: 50px;
border-radius: var(--border-radius);
box-shadow: 0px 5px 4px var(--color-gray-4);
display: flex;
justify-content: center;
align-items: center;
}
.download_close_modal {
float: right;
margin-right: 10px;
font-size: 25px;
}
.download-progress__current-downloading {
position: fixed;
bottom: 25px;
right: 15px;
border: none;
width: 30px;
height: 30px;
display: flex;
justify-content: center;
align-items: center;
margin: 0;
animation-name: downloadcount;
animation-duration: 1.3s;
animation-iteration-count: infinite;
.notification__bubble {
height: 1.5rem;
width: 1.5rem;
border-radius: 50%;
background-color: var(--color-editor-tag);
position: absolute;
top: -0.5rem;
right: -0.5rem;
color: white;
font-size: var(--font-small);
font-weight: bold;
line-height: 1;
display: flex;
align-items: center;
justify-content: center;
}
.notification__bubble--small {
font-size: var(--font-xsmall);
}
.notification__bubble--inline {
@extend .notification__bubble;
top: 0.75rem;
right: 1rem;
}
}
@keyframes downloadcount {
0% {
transform: translateY(-10px);
}
50% {
transform: translateY(-3px);
}
100% {
transform: translateY(-10px);
}
}
-15
View File
@@ -437,18 +437,3 @@
// scrollbar for all browsers.
background-color: var(--color-scrollbar-thumb-bg);
}
::-webkit-scrollbar {
width: 12px;
height: 12px;
}
::-webkit-scrollbar-track {
background-color: transparent;
border-radius: 10px;
}
::-webkit-scrollbar-thumb {
background-color: var(--color-scrollbar-thumb-bg);
border-radius: 10px;
}
+2 -2
View File
@@ -75,7 +75,7 @@
.media__info-text--contracted {
margin-top: var(--spacing-m);
max-height: 5rem;
max-height: 3rem;
overflow: hidden;
}
@@ -90,7 +90,7 @@
}
.media__info-text--fade {
-webkit-mask-image: -webkit-gradient(linear, left 55%, left bottom, from(rgba(0, 0, 0, 1)), to(rgba(0, 0, 0, 0)));
-webkit-mask-image: -webkit-gradient(linear, left 30%, left bottom, from(rgba(0, 0, 0, 1)), to(rgba(0, 0, 0, 0)));
overflow-wrap: anywhere;
}
+6
View File
@@ -121,6 +121,12 @@
overflow-x: hidden;
}
.menu__link-disable {
@extend .menu__link;
color: var(--color-text-subtitle)!important;
}
.menu__link--notification {
width: 100%;
display: flex;
+18
View File
@@ -0,0 +1,18 @@
export function areEqual(first, second) {
if (first.length !== second.length) {
return false;
}
for (let i = 0; i < first.length; i++) {
if (!second.includes(first[i])) {
return false;
}
}
return true;
}
export function removeItem(array, item) {
const index = array.indexOf(item);
if (index > -1) {
array.splice(index, 1);
}
}
+4 -4
View File
@@ -235,7 +235,7 @@ export function GetLinksData(
)}`,
options: {
claimType: ['stream'],
orderBy: CS.ORDER_BY_NEW_VALUE,
orderBy: ['release_time'],
pageSize: getPageSize(12),
channelIds: YOUTUBER_CHANNEL_IDS,
limitClaimsPerChannel: 1,
@@ -248,7 +248,7 @@ export function GetLinksData(
link: `/$/${PAGES.DISCOVER}?${CS.ORDER_BY_KEY}=${CS.ORDER_BY_TOP}&${CS.FRESH_KEY}=${CS.FRESH_DAY}`,
options: {
pageSize: getPageSize(showPersonalizedChannels || showPersonalizedTags ? 4 : 8),
orderBy: CS.ORDER_BY_TOP_VALUE,
orderBy: ['effective_amount'],
claimType: ['stream'],
limitClaimsPerChannel: 2,
releaseTime: `>${Math.floor(moment().subtract(1, 'day').startOf('day').unix())}`,
@@ -259,7 +259,7 @@ export function GetLinksData(
title: __('Top Channels On LBRY'),
link: `/$/${PAGES.DISCOVER}?claim_type=channel&${CS.ORDER_BY_KEY}=${CS.ORDER_BY_TOP}&${CS.FRESH_KEY}=${CS.FRESH_ALL}`,
options: {
orderBy: CS.ORDER_BY_TOP_VALUE,
orderBy: ['effective_amount'],
claimType: ['channel'],
},
};
@@ -268,7 +268,7 @@ export function GetLinksData(
title: __('Latest From @lbry'),
link: `/@lbry:3f`,
options: {
orderBy: CS.ORDER_BY_NEW_VALUE,
orderBy: ['release_time'],
pageSize: getPageSize(4),
channelIds: ['3fda836a92faaceedfe398225fb9b2ee2ed1f01a'],
},
+24
View File
@@ -0,0 +1,24 @@
// @flow
/**
* Helper to extract livestream claim uris from the output of
* `selectActiveLivestreams`.
*
* @param activeLivestreams Object obtained from `selectActiveLivestreams`.
* @param channelIds List of channel IDs to filter the results with.
* @returns {[]|Array<*>}
*/
export function getLivestreamUris(activeLivestreams: ?LivestreamInfo, channelIds: ?Array<string>) {
let values = (activeLivestreams && Object.values(activeLivestreams)) || [];
if (channelIds && channelIds.length > 0) {
// $FlowFixMe
values = values.filter((v) => channelIds.includes(v.creatorId) && Boolean(v.latestClaimUri));
} else {
// $FlowFixMe
values = values.filter((v) => Boolean(v.latestClaimUri));
}
// $FlowFixMe
return values.map((v) => v.latestClaimUri);
}
+134 -41
View File
@@ -1153,7 +1153,14 @@
core-js-pure "^3.0.0"
regenerator-runtime "^0.13.4"
"@babel/runtime@^7.1.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.3.1", "@babel/runtime@^7.4.0", "@babel/runtime@^7.4.5", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.7", "@babel/runtime@^7.8.4":
"@babel/runtime@^7.1.2", "@babel/runtime@^7.3.1", "@babel/runtime@^7.4.0", "@babel/runtime@^7.4.5", "@babel/runtime@^7.7.7", "@babel/runtime@^7.8.4":
version "7.10.2"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.10.2.tgz#d103f21f2602497d38348a32e008637d506db839"
integrity sha512-6sF3uQw2ivImfVIl62RZ7MXhO2tap69WeWK57vAaimT6AZbE4FbqjdEJIN1UqoD6wI6B+1n9UiagafH1sxjOtg==
dependencies:
regenerator-runtime "^0.13.4"
"@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.5.5", "@babel/runtime@^7.9.2":
version "7.14.6"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.6.tgz#535203bc0892efc7dec60bdc27b2ecf6e409062d"
integrity sha512-/PCB2uJ7oM44tz8YhC4Z/6PeOKXp4K588f+5M3clr1M4zbqztlo0XEfJ2LEzj/FgwfgGcIdl8n7YYjTCI0BYwg==
@@ -1847,10 +1854,24 @@
resolved "https://registry.yarnpkg.com/@ungap/from-entries/-/from-entries-0.2.1.tgz#7e86196b8b2e99d73106a8f25c2a068326346354"
integrity sha512-CAqefTFAfnUPwYqsWHXpOxHaq1Zo5UQ3m9Zm2p09LggGe57rqHoBn3c++xcoomzXKynAUuiBMDUCQvKMnXjUpA==
"@videojs/http-streaming@2.9.2":
version "2.9.2"
resolved "https://registry.yarnpkg.com/@videojs/http-streaming/-/http-streaming-2.9.2.tgz#47d33bb02bd9c1287200398b1e85d213dee814d0"
integrity sha512-2ZsxJn4/nZZ6k6jIhic2l9ynGmKwprtuI5b3+M6JgqOSLvQQ/ah+heVs/0g2Ze7qJxodqR+aSY948JwJIz1gCw==
"@videojs/http-streaming@2.2.4":
version "2.2.4"
resolved "https://registry.yarnpkg.com/@videojs/http-streaming/-/http-streaming-2.2.4.tgz#c71bb63dbc4749e35193c4c334430bd8ce728ec0"
integrity sha512-gzT46RpAEegOhMId/zZ6uXCVGDMPOv8qmoTykBuvd6/4lVM3lZ1ZJCq0kytAkisDuDKipy93gP46oZEtonlc/Q==
dependencies:
"@babel/runtime" "^7.5.5"
"@videojs/vhs-utils" "^2.2.1"
aes-decrypter "3.1.0"
global "^4.3.2"
m3u8-parser "4.5.0"
mpd-parser "0.14.0"
mux.js "5.6.7"
video.js "^6 || ^7"
"@videojs/http-streaming@2.9.1":
version "2.9.1"
resolved "https://registry.yarnpkg.com/@videojs/http-streaming/-/http-streaming-2.9.1.tgz#16b59efe24a832b89b5bd6a6c52f0d80ad7996a2"
integrity sha512-QAtlrBBILOflrei1KE0GcSDDWiP888ZOySck6zWlQNYi/pXOm6QXTJHzOMIKiRQOndyJIZRTfLHedeUdUIDNLA==
dependencies:
"@babel/runtime" "^7.12.5"
"@videojs/vhs-utils" "^3.0.2"
@@ -1858,9 +1879,18 @@
global "^4.4.0"
m3u8-parser "4.7.0"
mpd-parser "0.17.0"
mux.js "5.12.2"
mux.js "5.11.1"
video.js "^6 || ^7"
"@videojs/vhs-utils@^2.2.1":
version "2.3.0"
resolved "https://registry.yarnpkg.com/@videojs/vhs-utils/-/vhs-utils-2.3.0.tgz#490a3a00dfc1b51d85d5dcf8f8361e2d4c4d1440"
integrity sha512-ThSmm91S7tuIJ757ON50K4y7S/bvKN4+B0tu303gCOxaG57PoP1UvPfMQZ90XGhxwNgngexVojOqbBHhTvXVHQ==
dependencies:
"@babel/runtime" "^7.5.5"
global "^4.3.2"
url-toolkit "^2.1.6"
"@videojs/vhs-utils@^3.0.0", "@videojs/vhs-utils@^3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@videojs/vhs-utils/-/vhs-utils-3.0.2.tgz#0203418ecaaff29bc33c69b6ad707787347b7614"
@@ -2106,6 +2136,16 @@ adm-zip@^0.4.13:
version "0.4.14"
resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.14.tgz#2cf312bcc9f8875df835b0f6040bd89be0a727a9"
aes-decrypter@3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/aes-decrypter/-/aes-decrypter-3.1.0.tgz#fc0b1d703f97a64aa3f7b13528f4661971db68c4"
integrity sha512-wL1NFwP2yNrJG4InpXYFhhYe9TfonnDyhyxMq2+K9/qt+SrZzUieOpviN6pkDly7GawTqw5feehk0rn5iYo00g==
dependencies:
"@babel/runtime" "^7.5.5"
"@videojs/vhs-utils" "^2.2.1"
global "^4.3.2"
pkcs7 "^1.0.4"
aes-decrypter@3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/aes-decrypter/-/aes-decrypter-3.1.2.tgz#3545546f8e9f6b878640339a242efe221ba7a7cb"
@@ -5965,14 +6005,13 @@ electron-devtools-installer@^3.1.1:
semver "^7.2.1"
unzip-crx-3 "^0.2.0"
electron-dl@^3.2.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/electron-dl/-/electron-dl-3.3.0.tgz#4e422e276c627373ba61fcf3f92ffa088988db1a"
integrity sha512-Zwaz/OMGPIfBLV2SQH4sTsdDOs/U4y5AOHfremMBXEpjIxX+SiTx845DZAvJJwgb5hfowyWOBLiJhd/emBNLLQ==
electron-dl@^1.11.0:
version "1.14.0"
resolved "https://registry.yarnpkg.com/electron-dl/-/electron-dl-1.14.0.tgz#1466f1b945664ca3d784268307c2b935728177bf"
dependencies:
ext-name "^5.0.0"
pupa "^2.0.1"
unused-filename "^2.1.0"
pupa "^1.0.0"
unused-filename "^1.0.0"
electron-is-dev@^0.3.0:
version "0.3.0"
@@ -6081,10 +6120,10 @@ electron-window-state@^4.1.1:
jsonfile "^2.2.3"
mkdirp "^0.5.1"
electron@11.5.0:
version "11.5.0"
resolved "https://registry.yarnpkg.com/electron/-/electron-11.5.0.tgz#f1650543b9d8f2047d3807755bdb120153ed210f"
integrity sha512-WjNDd6lGpxyiNjE3LhnFCAk/D9GIj1rU3GSDealVShhkkkPR3Vh4q8ErXGDl1OAO/faomVa10KoFPUN/pLbNxg==
electron@9.4.0:
version "9.4.0"
resolved "https://registry.yarnpkg.com/electron/-/electron-9.4.0.tgz#c3c607e3598226ddbaaff8babcdffa8bb2210936"
integrity sha512-hOC4q0jkb+UDYZRy8vrZ1IANnq+jznZnbkD62OEo06nU+hIbp2IrwDRBNuSLmQ3cwZMVir0WSIA1qEVK0PkzGA==
dependencies:
"@electron/get" "^1.0.1"
"@types/node" "^12.0.12"
@@ -7908,6 +7947,14 @@ global-tunnel-ng@^2.7.1:
npm-conf "^1.1.3"
tunnel "^0.0.6"
global@4.3.2:
version "4.3.2"
resolved "https://registry.yarnpkg.com/global/-/global-4.3.2.tgz#e76989268a6c74c38908b1305b10fc0e394e9d0f"
integrity sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8=
dependencies:
min-document "^2.19.0"
process "~0.5.1"
global@^4.3.0, global@^4.3.1, global@^4.3.2, global@^4.4.0, global@~4.4.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/global/-/global-4.4.0.tgz#3e7b105179006a323ed71aafca3e9c57a5cc6406"
@@ -10554,6 +10601,15 @@ lz-string@^1.4.4:
version "1.4.4"
resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.4.4.tgz#c0d8eaf36059f705796e1e344811cf4c498d3a26"
m3u8-parser@4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/m3u8-parser/-/m3u8-parser-4.5.0.tgz#9c30b32c9b69cc3f81b5e6789717fa84b9fdb9aa"
integrity sha512-RGm/1WVCX3o1bSWbJGmJUu4zTbtJy8lImtgHM4CESFvJRXYztr1j6SW/q9/ghYOrUjgH7radsIar+z1Leln0sA==
dependencies:
"@babel/runtime" "^7.5.5"
"@videojs/vhs-utils" "^2.2.1"
global "^4.3.2"
m3u8-parser@4.7.0:
version "4.7.0"
resolved "https://registry.yarnpkg.com/m3u8-parser/-/m3u8-parser-4.7.0.tgz#e01e8ce136098ade1b14ee691ea20fc4dc60abf6"
@@ -11097,6 +11153,16 @@ move-concurrently@^1.0.1:
rimraf "^2.5.4"
run-queue "^1.0.3"
mpd-parser@0.14.0:
version "0.14.0"
resolved "https://registry.yarnpkg.com/mpd-parser/-/mpd-parser-0.14.0.tgz#f666a80c1e284e46c6f76f010fc4f5292a021148"
integrity sha512-HqXQS3WLofcnYFcxv5oWdlciddUaEnN3NasXLVQ793mdnZRrinjz2Yk1DsUYPDYOUWf6ZBBqbFhaJT5LiT2ouA==
dependencies:
"@babel/runtime" "^7.5.5"
"@videojs/vhs-utils" "^2.2.1"
global "^4.3.2"
xmldom "^0.1.27"
mpd-parser@0.17.0:
version "0.17.0"
resolved "https://registry.yarnpkg.com/mpd-parser/-/mpd-parser-0.17.0.tgz#d7f3002edcb706f98993ef75846a713d056d3332"
@@ -11140,13 +11206,18 @@ mute-stream@0.0.7:
version "0.0.7"
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab"
mux.js@5.12.2:
version "5.12.2"
resolved "https://registry.yarnpkg.com/mux.js/-/mux.js-5.12.2.tgz#cd823312f4bb69adb8b9c5f45635b4451066d6e6"
integrity sha512-9OY1lrFIo7FxMeIC6aLUftiNv97AztufDfi30N7qDll1Pcy7bCxlHztyHp1Ce0KQwy2XqchGeENPS4v1NJngHQ==
mux.js@5.11.1:
version "5.11.1"
resolved "https://registry.yarnpkg.com/mux.js/-/mux.js-5.11.1.tgz#531192c2c5ee5e9abb6243ba58e2c1ef916b35eb"
integrity sha512-U/JKEU4GZfk2BpEQpPfmH81nF79UKK2a1QOb6PF9viPspJpexGt11YzR/nTKNWdfjWG0DGjcSU+zb2F52Z/q8w==
dependencies:
"@babel/runtime" "^7.11.2"
mux.js@5.6.7:
version "5.6.7"
resolved "https://registry.yarnpkg.com/mux.js/-/mux.js-5.6.7.tgz#d39fc85cded5a1257de9f6eeb5cf1578c4a63eb8"
integrity sha512-YSr6B8MUgE4S18MptbY2XM+JKGbw9JDkgs7YkuE/T2fpDKjOhZfb/nD6vmsVxvLYOExWNaQn1UGBp6PGsnTtew==
nan@^2.12.1:
version "2.14.0"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c"
@@ -12919,6 +12990,11 @@ process@^0.11.10:
resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"
integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI=
process@~0.5.1:
version "0.5.2"
resolved "https://registry.yarnpkg.com/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf"
integrity sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8=
progress@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f"
@@ -13058,6 +13134,10 @@ punycode@^2.1.0, punycode@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
pupa@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/pupa/-/pupa-1.0.0.tgz#9a9568a5af7e657b8462a6e9d5328743560ceff6"
pupa@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/pupa/-/pupa-2.0.1.tgz#dbdc9ff48ffbea4a26a069b6f9f7abb051008726"
@@ -13179,11 +13259,6 @@ rc@^1.0.1, rc@^1.1.6, rc@^1.2.8:
minimist "^1.2.0"
strip-json-comments "~2.0.1"
re-reselect@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/re-reselect/-/re-reselect-4.0.0.tgz#9ddec4c72c4d952f68caa5aa4b76a9ed38b75cac"
integrity sha512-wuygyq8TXUlSdVXv2kigXxQNOgdb9m7LbIjwfTNGSpaY1riLd5e+VeQjlQMyUtrk0oiyhi1AqIVynworl3qxHA==
react-async-script@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/react-async-script/-/react-async-script-1.1.1.tgz#f481c6c5f094bf4b94a9d52da0d0dda2e1a74bdf"
@@ -15702,9 +15777,9 @@ tmp@^0.0.33:
os-tmpdir "~1.0.2"
tmpl@1.0.x:
version "1.0.5"
resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc"
integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==
version "1.0.4"
resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1"
integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=
to-arraybuffer@^1.0.0:
version "1.0.1"
@@ -16203,13 +16278,12 @@ untildify@^4.0.0:
resolved "https://registry.yarnpkg.com/untildify/-/untildify-4.0.0.tgz#2bc947b953652487e4600949fb091e3ae8cd919b"
integrity sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==
unused-filename@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/unused-filename/-/unused-filename-2.1.0.tgz#33719c4e8d9644f32d2dec1bc8525c6aaeb4ba51"
integrity sha512-BMiNwJbuWmqCpAM1FqxCTD7lXF97AvfQC8Kr/DIeA6VtvhJaMDupZ82+inbjl5yVP44PcxOuCSxye1QMS0wZyg==
unused-filename@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/unused-filename/-/unused-filename-1.0.0.tgz#d340880f71ae2115ebaa1325bef05cc6684469c6"
dependencies:
modify-filename "^1.1.0"
path-exists "^4.0.0"
path-exists "^3.0.0"
unzip-crx-3@^0.2.0:
version "0.2.0"
@@ -16344,7 +16418,7 @@ url-to-options@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9"
url-toolkit@^2.2.1:
url-toolkit@^2.1.6, url-toolkit@^2.2.1:
version "2.2.2"
resolved "https://registry.yarnpkg.com/url-toolkit/-/url-toolkit-2.2.2.tgz#51ef27b56d3187185f9ecf4a8ac7e8f55203c89d"
integrity sha512-l25w6Sy+Iy3/IbogunxhWwljPaDnqpiKvrQRoLBm6DfISco7NyRIS7Zf6+Oxhy1T8kHxWdwLND7ZZba6NjXMug==
@@ -16489,13 +16563,13 @@ vfile@^2.0.0:
unist-util-stringify-position "^1.0.0"
vfile-message "^1.0.0"
"video.js@^6 || ^7", video.js@^7.0.0, video.js@^7.14.3:
version "7.14.3"
resolved "https://registry.yarnpkg.com/video.js/-/video.js-7.14.3.tgz#0b612c09a0a81ef9bce65c710e73291cb06dc32c"
integrity sha512-6avCdSIfn5ss5NOgoQfY/xEfPNcz9DXSw+ZN80NwPguCdRd4VL4y40b/d7osYJwyCdF+YkvhqAW7dw4s0vBigg==
"video.js@^6 || ^7", video.js@^7.13.3:
version "7.13.3"
resolved "https://registry.yarnpkg.com/video.js/-/video.js-7.13.3.tgz#5efab7bd56267406307f64d110662b2ccb3d7530"
integrity sha512-rIGPFRh3v0HqSdfj+/iByKRDBgLVqILK/4i/hW15DfjvgCGhwbw53bRBoJXy496hwh/XYeOAqckc87L2FN375g==
dependencies:
"@babel/runtime" "^7.12.5"
"@videojs/http-streaming" "2.9.2"
"@videojs/http-streaming" "2.9.1"
"@videojs/vhs-utils" "^3.0.2"
"@videojs/xhr" "2.5.1"
aes-decrypter "3.1.2"
@@ -16503,11 +16577,25 @@ vfile@^2.0.0:
keycode "^2.2.0"
m3u8-parser "4.7.0"
mpd-parser "0.17.0"
mux.js "5.12.2"
mux.js "5.11.1"
safe-json-parse "4.0.0"
videojs-font "3.2.0"
videojs-vtt.js "^0.15.3"
video.js@^7.0.0:
version "7.10.2"
resolved "https://registry.yarnpkg.com/video.js/-/video.js-7.10.2.tgz#5156aabad7820e726d72ea6c32324059c68885a4"
integrity sha512-kJTTrqcQn2MhPzWR8zQs6W3HPJWpowO/ZGZcKt2dcJeJdJT0dEDLYtiFdjV37SylCmu66V0flRnV8cipbthveQ==
dependencies:
"@babel/runtime" "^7.9.2"
"@videojs/http-streaming" "2.2.4"
"@videojs/xhr" "2.5.1"
global "4.3.2"
keycode "^2.2.0"
safe-json-parse "4.0.0"
videojs-font "3.2.0"
videojs-vtt.js "^0.15.2"
videojs-contrib-ads@^6.6.5, videojs-contrib-ads@^6.9.0:
version "6.9.0"
resolved "https://registry.yarnpkg.com/videojs-contrib-ads/-/videojs-contrib-ads-6.9.0.tgz#c792d6fda77254b277545cc3222352fc653b5833"
@@ -16556,7 +16644,7 @@ videojs-logo@^2.1.4:
global "^4.3.2"
video.js "^6 || ^7"
videojs-vtt.js@^0.15.3:
videojs-vtt.js@^0.15.2, videojs-vtt.js@^0.15.3:
version "0.15.3"
resolved "https://registry.yarnpkg.com/videojs-vtt.js/-/videojs-vtt.js-0.15.3.tgz#84260393b79487fcf195d9372f812d7fab83a993"
integrity sha512-5FvVsICuMRx6Hd7H/Y9s9GDeEtYcXQWzGMS+sl4UX3t/zoHp3y+isSfIPRochnTH7h+Bh1ILyC639xy9Z6kPag==
@@ -17188,6 +17276,11 @@ xmlbuilder@^10.0.0:
version "10.1.1"
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-10.1.1.tgz#8cae6688cc9b38d850b7c8d3c0a4161dcaf475b0"
xmldom@^0.1.27:
version "0.1.31"
resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.1.31.tgz#b76c9a1bd9f0a9737e5a72dc37231cf38375e2ff"
integrity sha512-yS2uJflVQs6n+CyjHoaBmVSqIDevTAWrzMmjG1Gc7h1qQ7uVozNhEPJAwZXWyGQ/Gafo3fCwrcaokezLPupVyQ==
xmldom@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.3.0.tgz#e625457f4300b5df9c2e1ecb776147ece47f3e5a"