Compare commits
6 Commits
master
...
refactor-m
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fce73b1022 | ||
|
|
c2b4acf0d2 | ||
|
|
3d80c493d3 | ||
|
|
5896e7b33d | ||
|
|
1fb38b8a2c | ||
|
|
0c2715225b |
40
.github/workflows/deploy.yml
vendored
40
.github/workflows/deploy.yml
vendored
@@ -2,35 +2,33 @@ name: Node.js CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v3
|
||||
- run: corepack enable
|
||||
- run: yarn
|
||||
- run: yarn lint
|
||||
|
||||
build:
|
||||
needs: ['lint']
|
||||
# needs: ['lint']
|
||||
name: 'build'
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [16.x]
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macos-13
|
||||
- macos-latest
|
||||
- windows-latest
|
||||
runs-on: ${{ matrix.os }}
|
||||
continue-on-error: true
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-node@v5
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: corepack enable
|
||||
@@ -38,7 +36,23 @@ jobs:
|
||||
- uses: maxim-lobanov/setup-xcode@v1
|
||||
if: startsWith(runner.os, 'mac')
|
||||
with:
|
||||
xcode-version: '15.2.0'
|
||||
xcode-version: '13.1.0'
|
||||
# This is gonna be hacky.
|
||||
# Github made us upgrade xcode, which would force an upgrade of electron-builder to fix mac.
|
||||
# But there were bugs with copyfiles / extraFiles that kept seeing duplicates erroring on ln.
|
||||
# A flag USE_HARD_LINKS=false in electron-builder.json was suggested in comments, but that broke windows builds.
|
||||
# So for now we'll install python2 on mac and make sure it can find it.
|
||||
# Remove this after successfully upgrading electron-builder.
|
||||
# HACK part 1
|
||||
- uses: Homebrew/actions/setup-homebrew@master
|
||||
if: startsWith(runner.os, 'mac')
|
||||
# HACK part 2
|
||||
- name: Install Python2
|
||||
if: startsWith(runner.os, 'mac')
|
||||
run: |
|
||||
/bin/bash -c "$(curl -fsSL https://github.com/alfredapp/dependency-scripts/raw/main/scripts/install-python2.sh)"
|
||||
echo "PYTHON_PATH=/usr/local/bin/python" >> $GITHUB_ENV
|
||||
|
||||
- name: Download blockchain headers
|
||||
run: |
|
||||
mkdir -p ./static/daemon
|
||||
@@ -54,10 +68,12 @@ jobs:
|
||||
GH_TOKEN: ${{ secrets.GH_TOKEN_NEW }}
|
||||
NOTARIZATION_USERNAME: ${{ secrets.NOTARIZATION_USERNAME }}
|
||||
NOTARIZATION_PASSWORD: ${{ secrets.NOTARIZATION_PASSWORD }}
|
||||
# CSC_LINK: ${{ secrets.CSC_LINK }}
|
||||
# CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
|
||||
# WIN_CSC_LINK: ${{ secrets.WIN_CSC_LINK }}
|
||||
# WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
|
||||
WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
|
||||
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
|
||||
|
||||
WIN_CSC_LINK: https://raw.githubusercontent.com/lbryio/lbry-desktop/master/build/cert2023.pfx
|
||||
CSC_LINK: https://s3.amazonaws.com/files.lbry.io/cert/osx-csc-2021-2022.p12
|
||||
|
||||
# UI
|
||||
MATOMO_URL: https://analytics.lbry.com/
|
||||
MATOMO_ID: 4
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
7be62bc9
|
||||
@@ -1,10 +0,0 @@
|
||||
name: build
|
||||
base: ubuntu@24.04
|
||||
|
||||
sdks:
|
||||
- name: node
|
||||
channel: 20/stable
|
||||
# project requires node 20 and yarn to build so we install them here
|
||||
actions:
|
||||
setup: |
|
||||
npm install -g yarn@1
|
||||
@@ -1,27 +0,0 @@
|
||||
name: dev
|
||||
base: ubuntu@24.04
|
||||
|
||||
sdks:
|
||||
- name: opencode
|
||||
channel: 1/stable
|
||||
plugs:
|
||||
lmstudio:
|
||||
interface: tunnel
|
||||
endpoint: localhost:1234
|
||||
#There used to be a plug here for binding your host directory in, but seemingly, OpenCode's sdk has it's own predefined plugin.
|
||||
#Just use dev/opencode:opencode-config instead
|
||||
- name: puppeteer-chrome
|
||||
- name: node
|
||||
channel: 20/stable
|
||||
- name: system
|
||||
slots:
|
||||
lmstudio:
|
||||
interface: tunnel
|
||||
endpoint: localhost:1234 # LM Studio
|
||||
# project requires node 20 and yarn to build so we install them here
|
||||
actions:
|
||||
setup: |
|
||||
npm install -g yarn@1
|
||||
echo "export OPENCODE_PERMISSIONS__BASH=allow" >> /home/workshop/.bashrc
|
||||
echo "export OPENCODE_PERMISSIONS__WRITE=allow" >> /home/workshop/.bashrc
|
||||
echo "export OPENCODE_PERMISSIONS__READ=allow" >> /home/workshop/.bashrc
|
||||
@@ -13,8 +13,7 @@ module.exports = async function() {
|
||||
const appPath = path.resolve(__dirname, '../dist/electron/mac/LBRY.app');
|
||||
|
||||
if (!fs.existsSync(appPath)) {
|
||||
console.log(`Cannot find application at: ${appPath}`);
|
||||
// TODO throw new Error(`Cannot find application at: ${appPath}`);
|
||||
throw new Error(`Cannot find application at: ${appPath}`);
|
||||
}
|
||||
|
||||
console.log(`Notarizing ${appId} found at ${appPath}`);
|
||||
|
||||
@@ -8,10 +8,10 @@ const config = {
|
||||
WEBPACK_WEB_PORT: process.env.WEBPACK_WEB_PORT,
|
||||
WEBPACK_ELECTRON_PORT: process.env.WEBPACK_ELECTRON_PORT,
|
||||
WEB_SERVER_PORT: process.env.WEB_SERVER_PORT,
|
||||
LBRY_WEB_API: process.env.LBRY_WEB_API, // api.na-backend.odysee.com',
|
||||
LBRY_WEB_API: process.env.LBRY_WEB_API, //api.na-backend.odysee.com',
|
||||
LBRY_WEB_PUBLISH_API: process.env.LBRY_WEB_PUBLISH_API,
|
||||
LBRY_API_URL: process.env.LBRY_API_URL, // api.lbry.com',
|
||||
LBRY_WEB_STREAMING_API: process.env.LBRY_WEB_STREAMING_API, // player.odysee.com
|
||||
LBRY_API_URL: process.env.LBRY_API_URL, //api.lbry.com',
|
||||
LBRY_WEB_STREAMING_API: process.env.LBRY_WEB_STREAMING_API, //player.odysee.com
|
||||
LBRY_WEB_BUFFER_API: process.env.LBRY_WEB_BUFFER_API,
|
||||
SEARCH_SERVER_API: process.env.SEARCH_SERVER_API,
|
||||
CLOUD_CONNECT_SITE_NAME: process.env.CLOUD_CONNECT_SITE_NAME,
|
||||
|
||||
@@ -14,6 +14,27 @@
|
||||
"to": "./"
|
||||
}
|
||||
],
|
||||
"extraResources": [
|
||||
{
|
||||
"from": "./static/daemon/",
|
||||
"to": "static/daemon/",
|
||||
"filter": ["**/*"]
|
||||
},
|
||||
{
|
||||
"from": "./static/img",
|
||||
"to": "static/img",
|
||||
"filter": ["**/*"]
|
||||
},
|
||||
{
|
||||
"from": "./static/font",
|
||||
"to": "static/font",
|
||||
"filter": ["**/*"]
|
||||
},
|
||||
{
|
||||
"from": "./static/app-update.yml",
|
||||
"to": "app-update.yml"
|
||||
}
|
||||
],
|
||||
"publish": [
|
||||
{
|
||||
"provider": "github"
|
||||
|
||||
@@ -57,7 +57,7 @@ mainInstance.waitUntilValid(() => {
|
||||
console.log(data.toString());
|
||||
});
|
||||
|
||||
process.on('SIGINT', function() {
|
||||
process.on('SIGINT', function () {
|
||||
console.log('Killing threads...');
|
||||
|
||||
child.kill('SIGINT');
|
||||
|
||||
@@ -18,9 +18,9 @@ import installDevtools from './installDevtools';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { diskSpaceLinux, diskSpaceWindows, diskSpaceMac } from '../ui/util/diskspace';
|
||||
import mime from 'mime';
|
||||
|
||||
const { download } = require('electron-dl');
|
||||
const mime = require('mime');
|
||||
const remote = require('@electron/remote/main');
|
||||
const os = require('os');
|
||||
const sudo = require('sudo-prompt');
|
||||
@@ -366,13 +366,12 @@ ipcMain.handle('get-file-details-from-path', async (event, path) => {
|
||||
const name = folders[folders.length - 1];
|
||||
let duration = 0, size = 0, mimeType;
|
||||
try {
|
||||
const stats = await fs.promises.stat(path);
|
||||
size = stats.size;
|
||||
await fs.promises.stat(path);
|
||||
let ffprobeResults;
|
||||
try {
|
||||
ffprobeResults = await probe(path);
|
||||
duration = ffprobeResults.format.duration;
|
||||
size = ffprobeResults.format.size || stats.size;
|
||||
size = ffprobeResults.format.size;
|
||||
} catch (e) {
|
||||
}
|
||||
let fileReadResult;
|
||||
|
||||
@@ -37,7 +37,7 @@ Lbryio.call = (resource, action, params = {}, method = 'get') => {
|
||||
}
|
||||
|
||||
if (response)
|
||||
{ return response.json().then(json => {
|
||||
return response.json().then(json => {
|
||||
let error;
|
||||
if (json.error) {
|
||||
error = new Error(json.error);
|
||||
@@ -46,7 +46,7 @@ Lbryio.call = (resource, action, params = {}, method = 'get') => {
|
||||
}
|
||||
error.response = response; // This is primarily a hack used in actions/user.js
|
||||
return Promise.reject(error);
|
||||
}); }
|
||||
});
|
||||
}
|
||||
|
||||
function makeRequest(url, options) {
|
||||
|
||||
@@ -54,7 +54,7 @@ const recsys = {
|
||||
* @param parentClaimId: string,
|
||||
* @param newClaimId: string,
|
||||
*/
|
||||
onClickedRecommended: function(parentClaimId, newClaimId) {
|
||||
onClickedRecommended: function (parentClaimId, newClaimId) {
|
||||
const parentEntry = recsys.entries[parentClaimId] ? recsys.entries[parentClaimId] : null;
|
||||
const parentUuid = parentEntry['uuid'];
|
||||
const parentRecommendedClaims = parentEntry['recClaimIds'] || [];
|
||||
@@ -72,7 +72,7 @@ const recsys = {
|
||||
* Page was loaded. Get or Create entry and populate it with default data, plus recommended content, recsysId, etc.
|
||||
* Called from recommendedContent component
|
||||
*/
|
||||
onRecsLoaded: function(claimId, uris) {
|
||||
onRecsLoaded: function (claimId, uris) {
|
||||
if (window.store) {
|
||||
const state = window.store.getState();
|
||||
if (!recsys.entries[claimId]) {
|
||||
@@ -91,7 +91,7 @@ const recsys = {
|
||||
* @param: claimId: string
|
||||
* @param: parentUuid: string (optional)
|
||||
*/
|
||||
createRecsysEntry: function(claimId, parentUuid) {
|
||||
createRecsysEntry: function (claimId, parentUuid) {
|
||||
if (window.store && claimId) {
|
||||
const state = window.store.getState();
|
||||
const user = selectUser(state);
|
||||
@@ -128,7 +128,7 @@ const recsys = {
|
||||
* @param claimId
|
||||
* @param isTentative
|
||||
*/
|
||||
sendRecsysEntry: function(claimId, isTentative) {
|
||||
sendRecsysEntry: function (claimId, isTentative) {
|
||||
const shareTelemetry =
|
||||
IS_WEB || (window && window.store && selectDaemonSettings(window.store.getState()).share_usage_data);
|
||||
|
||||
@@ -151,7 +151,7 @@ const recsys = {
|
||||
* @param claimId
|
||||
* @param event
|
||||
*/
|
||||
onRecsysPlayerEvent: function(claimId, event, isEmbedded) {
|
||||
onRecsysPlayerEvent: function (claimId, event, isEmbedded) {
|
||||
if (!recsys.entries[claimId]) {
|
||||
recsys.createRecsysEntry(claimId);
|
||||
// do something to show it's floating or autoplay
|
||||
@@ -162,7 +162,7 @@ const recsys = {
|
||||
recsys.entries[claimId].events.push(event);
|
||||
recsys.log('onRecsysPlayerEvent', claimId);
|
||||
},
|
||||
log: function(callName, claimId) {
|
||||
log: function (callName, claimId) {
|
||||
if (recsys.debug) {
|
||||
console.log(`Call: ***${callName}***, ClaimId: ${claimId}, Recsys Entries`, Object.assign({}, recsys.entries));
|
||||
}
|
||||
@@ -172,7 +172,7 @@ const recsys = {
|
||||
* Player closed. Check to see if primaryUri = playingUri
|
||||
* if so, send the Entry.
|
||||
*/
|
||||
onPlayerDispose: function(claimId, isEmbedded) {
|
||||
onPlayerDispose: function (claimId, isEmbedded) {
|
||||
if (window.store) {
|
||||
const state = window.store.getState();
|
||||
const playingUri = selectPlayingUri(state);
|
||||
@@ -221,7 +221,7 @@ const recsys = {
|
||||
* Navigate event
|
||||
* Send all claimIds that aren't currently playing.
|
||||
*/
|
||||
onNavigate: function() {
|
||||
onNavigate: function () {
|
||||
if (window.store) {
|
||||
const state = window.store.getState();
|
||||
const playingUri = selectPlayingUri(state);
|
||||
|
||||
1
flow-typed/npm/async-exit-hook_vx.x.x.js
vendored
1
flow-typed/npm/async-exit-hook_vx.x.x.js
vendored
@@ -23,6 +23,7 @@ declare module 'async-exit-hook' {
|
||||
* needed.
|
||||
*/
|
||||
|
||||
|
||||
// Filename aliases
|
||||
declare module 'async-exit-hook/index' {
|
||||
declare module.exports: $Exports<'async-exit-hook'>;
|
||||
|
||||
2
flow-typed/npm/bluebird_v3.x.x.js
vendored
2
flow-typed/npm/bluebird_v3.x.x.js
vendored
@@ -322,7 +322,7 @@ declare class Bluebird$Defer {
|
||||
reject: (value: any) => any;
|
||||
}
|
||||
|
||||
declare module 'bluebird' {
|
||||
declare module "bluebird" {
|
||||
declare module.exports: typeof Bluebird$Promise;
|
||||
|
||||
declare type Disposable<T> = Bluebird$Disposable<T>;
|
||||
|
||||
2
flow-typed/npm/chalk_v2.x.x.js
vendored
2
flow-typed/npm/chalk_v2.x.x.js
vendored
@@ -3,7 +3,7 @@
|
||||
|
||||
// From: https://github.com/chalk/chalk/blob/master/index.js.flow
|
||||
|
||||
declare module 'chalk' {
|
||||
declare module "chalk" {
|
||||
declare type TemplateStringsArray = $ReadOnlyArray<string>;
|
||||
|
||||
declare type Level = $Values<{
|
||||
|
||||
6
flow-typed/npm/classnames_v2.x.x.js
vendored
6
flow-typed/npm/classnames_v2.x.x.js
vendored
@@ -8,16 +8,16 @@ type $npm$classnames$Classes =
|
||||
| void
|
||||
| null;
|
||||
|
||||
declare module 'classnames' {
|
||||
declare module "classnames" {
|
||||
declare module.exports: (
|
||||
...classes: Array<$npm$classnames$Classes | $npm$classnames$Classes[]>
|
||||
) => string;
|
||||
}
|
||||
|
||||
declare module 'classnames/bind' {
|
||||
declare module "classnames/bind" {
|
||||
declare module.exports: $Exports<"classnames">;
|
||||
}
|
||||
|
||||
declare module 'classnames/dedupe' {
|
||||
declare module "classnames/dedupe" {
|
||||
declare module.exports: $Exports<"classnames">;
|
||||
}
|
||||
|
||||
1
flow-typed/npm/decompress_vx.x.x.js
vendored
1
flow-typed/npm/decompress_vx.x.x.js
vendored
@@ -23,6 +23,7 @@ declare module 'decompress' {
|
||||
* needed.
|
||||
*/
|
||||
|
||||
|
||||
// Filename aliases
|
||||
declare module 'decompress/index' {
|
||||
declare module.exports: $Exports<'decompress'>;
|
||||
|
||||
2
flow-typed/npm/del_v3.x.x.js
vendored
2
flow-typed/npm/del_v3.x.x.js
vendored
@@ -37,7 +37,7 @@ type $npm$del$Options = {
|
||||
absolute?: boolean
|
||||
};
|
||||
|
||||
declare module 'del' {
|
||||
declare module "del" {
|
||||
declare class Del {
|
||||
(
|
||||
patterns: $npm$del$Patterns,
|
||||
|
||||
1
flow-typed/npm/electron-dl_vx.x.x.js
vendored
1
flow-typed/npm/electron-dl_vx.x.x.js
vendored
@@ -23,6 +23,7 @@ declare module 'electron-dl' {
|
||||
* needed.
|
||||
*/
|
||||
|
||||
|
||||
// Filename aliases
|
||||
declare module 'electron-dl/index' {
|
||||
declare module.exports: $Exports<'electron-dl'>;
|
||||
|
||||
1
flow-typed/npm/electron-is-dev_vx.x.x.js
vendored
1
flow-typed/npm/electron-is-dev_vx.x.x.js
vendored
@@ -23,6 +23,7 @@ declare module 'electron-is-dev' {
|
||||
* needed.
|
||||
*/
|
||||
|
||||
|
||||
// Filename aliases
|
||||
declare module 'electron-is-dev/index' {
|
||||
declare module.exports: $Exports<'electron-is-dev'>;
|
||||
|
||||
@@ -23,6 +23,7 @@ declare module 'electron-window-state' {
|
||||
* needed.
|
||||
*/
|
||||
|
||||
|
||||
// Filename aliases
|
||||
declare module 'electron-window-state/index' {
|
||||
declare module.exports: $Exports<'electron-window-state'>;
|
||||
|
||||
@@ -23,6 +23,7 @@ declare module 'eslint-config-standard-jsx' {
|
||||
* needed.
|
||||
*/
|
||||
|
||||
|
||||
// Filename aliases
|
||||
declare module 'eslint-config-standard-jsx/index' {
|
||||
declare module.exports: $Exports<'eslint-config-standard-jsx'>;
|
||||
|
||||
@@ -23,6 +23,7 @@ declare module 'eslint-config-standard' {
|
||||
* needed.
|
||||
*/
|
||||
|
||||
|
||||
// Filename aliases
|
||||
declare module 'eslint-config-standard/index' {
|
||||
declare module.exports: $Exports<'eslint-config-standard'>;
|
||||
|
||||
6
flow-typed/npm/express_v4.16.x.js
vendored
6
flow-typed/npm/express_v4.16.x.js
vendored
@@ -1,8 +1,8 @@
|
||||
// flow-typed signature: 164dcf1c9105e51cb17a374a807146a7
|
||||
// flow-typed version: c7f4cf7a4d/express_v4.16.x/flow_>=v0.93.x
|
||||
|
||||
import * as http from 'http';
|
||||
import type { Socket } from 'net';
|
||||
import * as http from "http";
|
||||
import type { Socket } from "net";
|
||||
|
||||
declare type express$RouterOptions = {
|
||||
caseSensitive?: boolean,
|
||||
@@ -284,7 +284,7 @@ declare type express$UrlEncodedOptions = {
|
||||
) => mixed,
|
||||
}
|
||||
|
||||
declare module 'express' {
|
||||
declare module "express" {
|
||||
declare export type RouterOptions = express$RouterOptions;
|
||||
declare export type CookieOptions = express$CookieOptions;
|
||||
declare export type Middleware = express$Middleware;
|
||||
|
||||
2
flow-typed/npm/flow-bin_v0.x.x.js
vendored
2
flow-typed/npm/flow-bin_v0.x.x.js
vendored
@@ -1,6 +1,6 @@
|
||||
// flow-typed signature: 6a5610678d4b01e13bbfbbc62bdaf583
|
||||
// flow-typed version: 3817bc6980/flow-bin_v0.x.x/flow_>=v0.25.x
|
||||
|
||||
declare module 'flow-bin' {
|
||||
declare module "flow-bin" {
|
||||
declare module.exports: string;
|
||||
}
|
||||
|
||||
1
flow-typed/npm/json-loader_vx.x.x.js
vendored
1
flow-typed/npm/json-loader_vx.x.x.js
vendored
@@ -23,6 +23,7 @@ declare module 'json-loader' {
|
||||
* needed.
|
||||
*/
|
||||
|
||||
|
||||
// Filename aliases
|
||||
declare module 'json-loader/index' {
|
||||
declare module.exports: $Exports<'json-loader'>;
|
||||
|
||||
1
flow-typed/npm/lbry-format_vx.x.x.js
vendored
1
flow-typed/npm/lbry-format_vx.x.x.js
vendored
@@ -23,6 +23,7 @@ declare module 'lbry-format' {
|
||||
* needed.
|
||||
*/
|
||||
|
||||
|
||||
// Filename aliases
|
||||
declare module 'lbry-format/index' {
|
||||
declare module.exports: $Exports<'lbry-format'>;
|
||||
|
||||
14
flow-typed/npm/mixpanel-browser_v2.11.x.js
vendored
14
flow-typed/npm/mixpanel-browser_v2.11.x.js
vendored
@@ -3,11 +3,11 @@
|
||||
|
||||
declare module 'mixpanel-browser' {
|
||||
declare type People = {
|
||||
set(prop: Object | String, to?: any, callback?: Function): void;
|
||||
set_once(prop: Object | String, to?: any, callback?: Function): void;
|
||||
increment(prop: Object | string, by?: number, callback?: Function): void;
|
||||
append(prop: Object | string, value?: any, callback?: Function): void;
|
||||
union(prop: Object | string, value?: any, callback?: Function): void;
|
||||
set(prop: Object|String, to?: any, callback?: Function): void;
|
||||
set_once(prop: Object|String, to?: any, callback?: Function): void;
|
||||
increment(prop: Object|string, by?: number, callback?: Function): void;
|
||||
append(prop: Object|string, value?: any, callback?: Function): void;
|
||||
union(prop: Object|string, value?: any, callback?: Function): void;
|
||||
track_charge(amount: number, properties?: Object, callback?: Function): void;
|
||||
clear_charges(callback?: Function): void;
|
||||
delete_user(): void;
|
||||
@@ -18,8 +18,8 @@ declare module 'mixpanel-browser' {
|
||||
push(item: [string, Object]): void;
|
||||
disable(events?: string[]): void;
|
||||
track(event_name: string, properties?: Object, callback?: Function): void;
|
||||
track_links(query: Object | string, event_name: string, properties?: Object | Function): void;
|
||||
track_forms(query: Object | string, event_name: string, properties?: Object | Function): void;
|
||||
track_links(query: Object|string, event_name: string, properties?: Object|Function): void;
|
||||
track_forms(query: Object|string, event_name: string, properties?: Object|Function): void;
|
||||
time_event(event_name: string): void;
|
||||
register(properties: Object, days?: number): void;
|
||||
register_once(properties: Object, default_value?: any, days?: number): void;
|
||||
|
||||
11
flow-typed/npm/moment_v2.x.x.js
vendored
11
flow-typed/npm/moment_v2.x.x.js
vendored
@@ -69,7 +69,8 @@ declare class moment$LocaleData {
|
||||
isPM(date: string): boolean;
|
||||
meridiem(hours: number, minutes: number, isLower: boolean): string;
|
||||
calendar(
|
||||
key: | "sameDay"
|
||||
key:
|
||||
| "sameDay"
|
||||
| "nextDay"
|
||||
| "lastDay"
|
||||
| "nextWeek"
|
||||
@@ -122,7 +123,8 @@ declare class moment$Moment {
|
||||
static ISO_8601: string;
|
||||
static (string?: ?string): moment$Moment;
|
||||
static (
|
||||
initDate: | moment$MomentOptions
|
||||
initDate:
|
||||
| moment$MomentOptions
|
||||
| number
|
||||
| Date
|
||||
| Array<number>
|
||||
@@ -155,7 +157,8 @@ declare class moment$Moment {
|
||||
static unix(seconds: number): moment$Moment;
|
||||
static utc(): moment$Moment;
|
||||
static utc(
|
||||
initDate: | moment$MomentOptions
|
||||
initDate:
|
||||
| moment$MomentOptions
|
||||
| number
|
||||
| Date
|
||||
| Array<number>
|
||||
@@ -370,6 +373,6 @@ declare class moment$Moment {
|
||||
static invalid(object: any): moment$Moment;
|
||||
}
|
||||
|
||||
declare module 'moment' {
|
||||
declare module "moment" {
|
||||
declare module.exports: Class<moment$Moment>;
|
||||
}
|
||||
|
||||
1
flow-typed/npm/node-loader_vx.x.x.js
vendored
1
flow-typed/npm/node-loader_vx.x.x.js
vendored
@@ -23,6 +23,7 @@ declare module 'node-loader' {
|
||||
* needed.
|
||||
*/
|
||||
|
||||
|
||||
// Filename aliases
|
||||
declare module 'node-loader/index' {
|
||||
declare module.exports: $Exports<'node-loader'>;
|
||||
|
||||
2
flow-typed/npm/prettier_v1.x.x.js
vendored
2
flow-typed/npm/prettier_v1.x.x.js
vendored
@@ -1,7 +1,7 @@
|
||||
// flow-typed signature: 066c92e9ccb5f0711df8d73cbca837d6
|
||||
// flow-typed version: 9e32affdbd/prettier_v1.x.x/flow_>=v0.56.x
|
||||
|
||||
declare module 'prettier' {
|
||||
declare module "prettier" {
|
||||
declare export type AST = Object;
|
||||
declare export type Doc = Object;
|
||||
declare export type FastPath = Object;
|
||||
|
||||
1
flow-typed/npm/raw-loader_vx.x.x.js
vendored
1
flow-typed/npm/raw-loader_vx.x.x.js
vendored
@@ -23,6 +23,7 @@ declare module 'raw-loader' {
|
||||
* needed.
|
||||
*/
|
||||
|
||||
|
||||
// Filename aliases
|
||||
declare module 'raw-loader/index' {
|
||||
declare module.exports: $Exports<'raw-loader'>;
|
||||
|
||||
4
flow-typed/npm/react-hot-loader_v4.6.x.js
vendored
4
flow-typed/npm/react-hot-loader_v4.6.x.js
vendored
@@ -2,7 +2,7 @@
|
||||
// flow-typed version: 9d7a8571fd/react-hot-loader_v4.6.x/flow_>=v0.53.0
|
||||
|
||||
// @flow
|
||||
declare module 'react-hot-loader' {
|
||||
declare module "react-hot-loader" {
|
||||
declare type Module = {
|
||||
id: string,
|
||||
};
|
||||
@@ -50,7 +50,7 @@ declare module 'react-hot-loader' {
|
||||
declare export function setConfig(config: $Shape<Config>): void
|
||||
}
|
||||
|
||||
declare module 'react-hot-loader/root' {
|
||||
declare module "react-hot-loader/root" {
|
||||
import type { ContainerProps } from 'react-hot-loader';
|
||||
|
||||
declare export function hot<T: React$ComponentType<any>>(
|
||||
|
||||
2
flow-typed/npm/react-redux_v5.x.x.js
vendored
2
flow-typed/npm/react-redux_v5.x.x.js
vendored
@@ -31,7 +31,7 @@ Decrypting the abbreviations:
|
||||
EFO = Extra factory options (used only in connectAdvanced)
|
||||
*/
|
||||
|
||||
declare module 'react-redux' {
|
||||
declare module "react-redux" {
|
||||
// ------------------------------------------------------------
|
||||
// Typings for connect()
|
||||
// ------------------------------------------------------------
|
||||
|
||||
2
flow-typed/npm/react-toggle_v4.0.x.js
vendored
2
flow-typed/npm/react-toggle_v4.0.x.js
vendored
@@ -1,7 +1,7 @@
|
||||
// flow-typed signature: 7d44bba9041ba487f4fa83ab9d1bd3c3
|
||||
// flow-typed version: 064c20def6/react-toggle_v4.0.x/flow_>=v0.54.x
|
||||
|
||||
declare module 'react-toggle' {
|
||||
declare module "react-toggle" {
|
||||
declare type Icons = {
|
||||
checked?: React$Node,
|
||||
unchecked?: React$Node
|
||||
|
||||
1
flow-typed/npm/remark-react_vx.x.x.js
vendored
1
flow-typed/npm/remark-react_vx.x.x.js
vendored
@@ -23,6 +23,7 @@ declare module 'remark-react' {
|
||||
* needed.
|
||||
*/
|
||||
|
||||
|
||||
// Filename aliases
|
||||
declare module 'remark-react/index' {
|
||||
declare module.exports: $Exports<'remark-react'>;
|
||||
|
||||
1
flow-typed/npm/remark_vx.x.x.js
vendored
1
flow-typed/npm/remark_vx.x.x.js
vendored
@@ -23,6 +23,7 @@ declare module 'remark' {
|
||||
* needed.
|
||||
*/
|
||||
|
||||
|
||||
// Filename aliases
|
||||
declare module 'remark/index' {
|
||||
declare module.exports: $Exports<'remark'>;
|
||||
|
||||
1
flow-typed/npm/render-media_vx.x.x.js
vendored
1
flow-typed/npm/render-media_vx.x.x.js
vendored
@@ -23,6 +23,7 @@ declare module 'render-media' {
|
||||
* needed.
|
||||
*/
|
||||
|
||||
|
||||
// Filename aliases
|
||||
declare module 'render-media/index' {
|
||||
declare module.exports: $Exports<'render-media'>;
|
||||
|
||||
2
flow-typed/npm/reselect_v3.x.x.js
vendored
2
flow-typed/npm/reselect_v3.x.x.js
vendored
@@ -3,7 +3,7 @@
|
||||
|
||||
type ExtractReturnType = <Return>((...rest: any[]) => Return) => Return;
|
||||
|
||||
declare module 'reselect' {
|
||||
declare module "reselect" {
|
||||
declare type InputSelector<-TState, TProps, TResult> =
|
||||
(state: TState, props: TProps, ...rest: any[]) => TResult
|
||||
|
||||
|
||||
2
flow-typed/npm/semver_v5.1.x.js
vendored
2
flow-typed/npm/semver_v5.1.x.js
vendored
@@ -1,7 +1,7 @@
|
||||
// flow-typed signature: dc381ee55406f66b7272c6343db0834b
|
||||
// flow-typed version: da30fe6876/semver_v5.1.x/flow_>=v0.25.x
|
||||
|
||||
declare module 'semver' {
|
||||
declare module "semver" {
|
||||
declare type Release =
|
||||
| "major"
|
||||
| "premajor"
|
||||
|
||||
1
flow-typed/npm/stream-to-blob-url_vx.x.x.js
vendored
1
flow-typed/npm/stream-to-blob-url_vx.x.x.js
vendored
@@ -23,6 +23,7 @@ declare module 'stream-to-blob-url' {
|
||||
* needed.
|
||||
*/
|
||||
|
||||
|
||||
// Filename aliases
|
||||
declare module 'stream-to-blob-url/index' {
|
||||
declare module.exports: $Exports<'stream-to-blob-url'>;
|
||||
|
||||
45
flow-typed/npm/webpack_v4.x.x.js
vendored
45
flow-typed/npm/webpack_v4.x.x.js
vendored
@@ -64,7 +64,8 @@ declare module 'webpack' {
|
||||
declare type ExternalItem =
|
||||
| string
|
||||
| {
|
||||
[k: string]: | string
|
||||
[k: string]:
|
||||
| string
|
||||
| {
|
||||
[k: string]: any,
|
||||
}
|
||||
@@ -80,12 +81,14 @@ declare module 'webpack' {
|
||||
callback: (err?: Error, result?: string) => void
|
||||
) => void)
|
||||
| ExternalItem
|
||||
| Array<| ((
|
||||
| Array<
|
||||
| ((
|
||||
context: string,
|
||||
request: string,
|
||||
callback: (err?: Error, result?: string) => void
|
||||
) => void)
|
||||
| ExternalItem>;
|
||||
| ExternalItem
|
||||
>;
|
||||
|
||||
declare type RuleSetCondition =
|
||||
| RegExp
|
||||
@@ -143,7 +146,8 @@ declare module 'webpack' {
|
||||
rules?: RuleSetRules,
|
||||
sideEffects?: boolean,
|
||||
test?: RuleSetConditionOrConditions,
|
||||
type?: | 'javascript/auto'
|
||||
type?:
|
||||
| 'javascript/auto'
|
||||
| 'javascript/dynamic'
|
||||
| 'javascript/esm'
|
||||
| 'json'
|
||||
@@ -193,7 +197,8 @@ declare module 'webpack' {
|
||||
declare type OptimizationSplitChunksOptions = {
|
||||
automaticNameDelimiter?: string,
|
||||
cacheGroups?: {
|
||||
[k: string]: | false
|
||||
[k: string]:
|
||||
| false
|
||||
| Function
|
||||
| string
|
||||
| RegExp
|
||||
@@ -250,7 +255,8 @@ declare module 'webpack' {
|
||||
providedExports?: boolean,
|
||||
removeAvailableModules?: boolean,
|
||||
removeEmptyChunks?: boolean,
|
||||
runtimeChunk?: | boolean
|
||||
runtimeChunk?:
|
||||
| boolean
|
||||
| ('single' | 'multiple')
|
||||
| {
|
||||
name?: string | Function,
|
||||
@@ -267,7 +273,8 @@ declare module 'webpack' {
|
||||
};
|
||||
|
||||
declare type OutputOptions = {
|
||||
auxiliaryComment?: | string
|
||||
auxiliaryComment?:
|
||||
| string
|
||||
| {
|
||||
amd?: string,
|
||||
commonjs?: string,
|
||||
@@ -295,7 +302,8 @@ declare module 'webpack' {
|
||||
jsonpScriptType?: false | 'text/javascript' | 'module',
|
||||
library?: string | Array<string> | LibraryCustomUmdObject,
|
||||
libraryExport?: string | ArrayOfStringValues,
|
||||
libraryTarget?: | 'var'
|
||||
libraryTarget?:
|
||||
| 'var'
|
||||
| 'assign'
|
||||
| 'this'
|
||||
| 'window'
|
||||
@@ -329,7 +337,8 @@ declare module 'webpack' {
|
||||
declare type ArrayOfStringOrStringArrayValues = Array<string | Array<string>>;
|
||||
|
||||
declare type ResolveOptions = {
|
||||
alias?: | { [k: string]: string }
|
||||
alias?:
|
||||
| { [k: string]: string }
|
||||
| Array<{
|
||||
alias?: string,
|
||||
name?: string,
|
||||
@@ -375,7 +384,8 @@ declare module 'webpack' {
|
||||
chunkOrigins?: boolean,
|
||||
chunks?: boolean,
|
||||
chunksSort?: string,
|
||||
colors?: | boolean
|
||||
colors?:
|
||||
| boolean
|
||||
| {
|
||||
bold?: string,
|
||||
cyan?: string,
|
||||
@@ -438,7 +448,8 @@ declare module 'webpack' {
|
||||
disableHostCheck?: boolean,
|
||||
filename?: string,
|
||||
headers?: { [key: string]: string },
|
||||
historyApiFallback?: | boolean
|
||||
historyApiFallback?:
|
||||
| boolean
|
||||
| {
|
||||
rewrites?: Array<{ from: string, to: string }>,
|
||||
disableDotRule?: boolean,
|
||||
@@ -446,7 +457,8 @@ declare module 'webpack' {
|
||||
host?: string,
|
||||
hot?: boolean,
|
||||
hotOnly?: boolean,
|
||||
https?: | boolean
|
||||
https?:
|
||||
| boolean
|
||||
| {
|
||||
key: string,
|
||||
cert: string,
|
||||
@@ -458,7 +470,8 @@ declare module 'webpack' {
|
||||
noInfo?: boolean,
|
||||
open?: boolean | string,
|
||||
openPage?: string,
|
||||
overlay?: | boolean
|
||||
overlay?:
|
||||
| boolean
|
||||
| {
|
||||
errors?: boolean,
|
||||
warnings?: boolean,
|
||||
@@ -493,7 +506,8 @@ declare module 'webpack' {
|
||||
watchOptions?: WatchOptions,
|
||||
publicPath?: string,
|
||||
},
|
||||
devtool?: | '@cheap-eval-source-map'
|
||||
devtool?:
|
||||
| '@cheap-eval-source-map'
|
||||
| '@cheap-module-eval-source-map'
|
||||
| '@cheap-module-source-map'
|
||||
| '@cheap-source-map'
|
||||
@@ -554,7 +568,8 @@ declare module 'webpack' {
|
||||
resolveLoader?: ResolveOptions,
|
||||
serve?: { [k: string]: any },
|
||||
stats?: StatsOptions,
|
||||
target?: | 'web'
|
||||
target?:
|
||||
| 'web'
|
||||
| 'webworker'
|
||||
| 'node'
|
||||
| 'async-node'
|
||||
|
||||
1
flow-typed/npm/y18n_vx.x.x.js
vendored
1
flow-typed/npm/y18n_vx.x.x.js
vendored
@@ -23,6 +23,7 @@ declare module 'y18n' {
|
||||
* needed.
|
||||
*/
|
||||
|
||||
|
||||
// Filename aliases
|
||||
declare module 'y18n/index' {
|
||||
declare module.exports: $Exports<'y18n'>;
|
||||
|
||||
1
flow-typed/npm/yarnhook_vx.x.x.js
vendored
1
flow-typed/npm/yarnhook_vx.x.x.js
vendored
@@ -23,6 +23,7 @@ declare module 'yarnhook' {
|
||||
* needed.
|
||||
*/
|
||||
|
||||
|
||||
// Filename aliases
|
||||
declare module 'yarnhook/index' {
|
||||
declare module.exports: $Exports<'yarnhook'>;
|
||||
|
||||
2
flow-typed/reportContent.js
vendored
2
flow-typed/reportContent.js
vendored
@@ -5,3 +5,5 @@ declare type ReportContentState = {
|
||||
isReporting: boolean,
|
||||
error: string,
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -95,8 +95,8 @@ const YOUTUBER_CHANNEL_IDS = [
|
||||
channelLimit: 1,
|
||||
daysOfContent: 30,
|
||||
pageSize: 24,
|
||||
// pinnedUrls: [],
|
||||
// mixIn: [],
|
||||
//pinnedUrls: [],
|
||||
//mixIn: [],
|
||||
};
|
||||
|
||||
module.exports = { YOUTUBERS };
|
||||
|
||||
@@ -117,8 +117,8 @@
|
||||
"devtron": "^1.4.0",
|
||||
"dotenv-defaults": "^2.0.1",
|
||||
"dotenv-webpack": "^1.8.0",
|
||||
"electron": "17.4.11",
|
||||
"electron-builder": "^24.13.3",
|
||||
"electron": "17.2.0",
|
||||
"electron-builder": "^22.10.5",
|
||||
"electron-devtools-installer": "^3.1.1",
|
||||
"electron-is-dev": "^0.3.0",
|
||||
"electron-webpack": "^2.8.2",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module.exports = {
|
||||
plugins: {
|
||||
'postcss-import': {
|
||||
resolve: function(id) {
|
||||
resolve: function (id) {
|
||||
// Handle ~ imports for node_modules
|
||||
if (id.startsWith('~')) {
|
||||
try {
|
||||
@@ -11,7 +11,7 @@ module.exports = {
|
||||
}
|
||||
}
|
||||
return id;
|
||||
},
|
||||
}
|
||||
},
|
||||
cssnano: process.env.NODE_ENV === 'production' ? {} : false,
|
||||
},
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -236,15 +236,7 @@ function App(props: Props) {
|
||||
fetchModBlockedList();
|
||||
fetchModAmIList();
|
||||
}
|
||||
}, [
|
||||
fetchModAmIList,
|
||||
fetchModBlockedList,
|
||||
hasMyChannels,
|
||||
hasNoChannels,
|
||||
hasActiveChannelClaim,
|
||||
setActiveChannelIfNotSet,
|
||||
setIncognito,
|
||||
]);
|
||||
}, [hasMyChannels, hasNoChannels, hasActiveChannelClaim, setActiveChannelIfNotSet, setIncognito]);
|
||||
|
||||
useEffect(() => {
|
||||
// $FlowFixMe
|
||||
|
||||
@@ -102,7 +102,7 @@ function ChannelContent(props: Props) {
|
||||
}
|
||||
}, DEBOUNCE_WAIT_DURATION_MS);
|
||||
return () => clearTimeout(timer);
|
||||
}, [claimId, doResolveUris, searchQuery, showMature]);
|
||||
}, [claimId, searchQuery, showMature]);
|
||||
|
||||
React.useEffect(() => {
|
||||
setSearchQuery('');
|
||||
|
||||
@@ -121,7 +121,7 @@ function ChannelForm(props: Props) {
|
||||
bidError ||
|
||||
(isNewChannel && !params.name)
|
||||
);
|
||||
}, [coverError, isClaimingInitialRewards, creatingChannel, updatingChannel, bidError, isNewChannel, params.name]);
|
||||
}, [isClaimingInitialRewards, creatingChannel, updatingChannel, nameError, bidError, isNewChannel, params.name]);
|
||||
|
||||
function getChannelParams() {
|
||||
// fill this in with sdk data
|
||||
|
||||
@@ -385,7 +385,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
</NavLink>
|
||||
)}
|
||||
</div>
|
||||
<div className="claim-tile__info">
|
||||
<div className="claim-tile__info" uri={uri}>
|
||||
{!isChannelUri && signingChannel && (
|
||||
<div className="claim-preview__channel-staked">
|
||||
<UriIndicator focusable={false} uri={uri} link hideAnonymous>
|
||||
|
||||
@@ -260,7 +260,7 @@ function CollectionForm(props: Props) {
|
||||
const collectionClaimIds = JSON.parse(collectionClaimIdsString);
|
||||
setParams({ ...params, claims: collectionClaimIds });
|
||||
clearCollectionErrors();
|
||||
}, [clearCollectionErrors, params, collectionClaimIdsString, setParams]);
|
||||
}, [collectionClaimIdsString, setParams]);
|
||||
|
||||
React.useEffect(() => {
|
||||
let nameError;
|
||||
@@ -302,14 +302,14 @@ function CollectionForm(props: Props) {
|
||||
setParam({ channel_id: undefined });
|
||||
}
|
||||
}
|
||||
}, [setParam, activeChannelId, incognito, initialized]);
|
||||
}, [activeChannelId, incognito, initialized]);
|
||||
|
||||
// setup initial params after we're sure if it's published or not
|
||||
React.useEffect(() => {
|
||||
if (!uri || (uri && hasClaim)) {
|
||||
updateParams(getCollectionParams());
|
||||
}
|
||||
}, [uri, hasClaim, getCollectionParams, updateParams]);
|
||||
}, [uri, hasClaim]);
|
||||
|
||||
React.useEffect(() => {
|
||||
resetThumbnailStatus();
|
||||
|
||||
@@ -58,7 +58,7 @@ function FileList(props: Props) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}, [radio, onChange, getFile]);
|
||||
}, [radio, onChange]);
|
||||
|
||||
return (
|
||||
<div className={'file-list'}>
|
||||
|
||||
@@ -15,7 +15,7 @@ type Props = {
|
||||
error?: string,
|
||||
disabled?: boolean,
|
||||
autoFocus?: boolean,
|
||||
filters?: Array<{ name: string, extensions: string[] }>,
|
||||
filters?: Array<{ name: string, extension: string[] }>,
|
||||
readFile?: boolean,
|
||||
};
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ function LoginGraphic(props: any) {
|
||||
} else {
|
||||
setSrc(imgUrl);
|
||||
}
|
||||
}, [imgUrl]);
|
||||
}, []);
|
||||
|
||||
if (error || !imgUrl) {
|
||||
return null;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// @flow
|
||||
import type { Node } from 'react';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import React, { useState, useEffect, useCallback } from 'react';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { ipcRenderer } from 'electron';
|
||||
import { regexInvalidURI } from 'util/lbryURI';
|
||||
import PostEditor from 'component/postEditor';
|
||||
@@ -43,13 +43,6 @@ type Props = {
|
||||
setWaitForFile: (boolean) => void,
|
||||
};
|
||||
|
||||
const MARKDOWN_FILE_EXTENSIONS = ['txt', 'md', 'markdown'];
|
||||
|
||||
function parseName(newName) {
|
||||
let INVALID_URI_CHARS = new RegExp(regexInvalidURI, 'gu');
|
||||
return newName.replace(INVALID_URI_CHARS, '-');
|
||||
}
|
||||
|
||||
function PublishFile(props: Props) {
|
||||
const {
|
||||
uri,
|
||||
@@ -81,6 +74,7 @@ function PublishFile(props: Props) {
|
||||
const PROCESSING_MB_PER_SECOND = 0.5;
|
||||
const MINUTES_THRESHOLD = 30;
|
||||
const HOURS_THRESHOLD = MINUTES_THRESHOLD * 60;
|
||||
const MARKDOWN_FILE_EXTENSIONS = ['txt', 'md', 'markdown'];
|
||||
const sizeInMB = Number(size) / 1000000;
|
||||
const secondsToProcess = sizeInMB / PROCESSING_MB_PER_SECOND;
|
||||
const ffmpegAvail = ffmpegStatus.available;
|
||||
@@ -98,91 +92,6 @@ function PublishFile(props: Props) {
|
||||
}
|
||||
}, [currentFileType, mode, isStillEditing, updatePublishForm]);
|
||||
|
||||
const updateFileInfo = useCallback(
|
||||
(duration, size, isvid) => {
|
||||
updatePublishForm({ fileDur: duration, fileSize: size, fileVid: isvid });
|
||||
},
|
||||
[updatePublishForm]
|
||||
);
|
||||
|
||||
const handleFileReaderLoaded = useCallback(
|
||||
(event: ProgressEvent) => {
|
||||
// See: https://github.com/facebook/flow/issues/3470
|
||||
if (event.target instanceof FileReader) {
|
||||
const text = event.target.result;
|
||||
updatePublishForm({ fileText: text });
|
||||
setPublishMode(PUBLISH_MODES.POST);
|
||||
}
|
||||
},
|
||||
[updatePublishForm, setPublishMode]
|
||||
);
|
||||
|
||||
const processSelectedFile = useCallback(
|
||||
(fileData: FileData, clearName = true) => {
|
||||
window.URL = window.URL || window.webkitURL;
|
||||
|
||||
// select file, start to select a new one, then cancel
|
||||
if (!fileData || fileData.error) {
|
||||
if (isStillEditing || !clearName) {
|
||||
updatePublishForm({ filePath: '' });
|
||||
} else {
|
||||
updatePublishForm({ filePath: '', name: '' });
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// if video, extract duration so we can warn about bitrate if (typeof file !== 'string')
|
||||
const file = fileData.file;
|
||||
// Check to see if it's a video and if mp4
|
||||
const contentType = fileData.mimeType && fileData.mimeType.split('/'); // get this from electron side
|
||||
const duration = fileData.duration;
|
||||
const size = fileData.size;
|
||||
const isVideo = contentType && contentType[0] === 'video';
|
||||
const isMp4 = contentType && contentType[1] === 'mp4';
|
||||
|
||||
let isTextPost = false;
|
||||
|
||||
if (contentType && contentType[0] === 'text') {
|
||||
isTextPost = contentType[1] === 'plain' || contentType[1] === 'markdown';
|
||||
setCurrentFileType(contentType.join('/'));
|
||||
} else if (path.parse(fileData.path).ext) {
|
||||
// If user's machine is missing a valid content type registration
|
||||
// for markdown content: text/markdown, file extension will be used instead
|
||||
const extension = path.parse(fileData.path).ext;
|
||||
isTextPost = MARKDOWN_FILE_EXTENSIONS.includes(extension);
|
||||
}
|
||||
|
||||
if (isVideo) {
|
||||
if (isMp4) {
|
||||
updateFileInfo(duration || 0, size, isVideo);
|
||||
} else {
|
||||
updateFileInfo(duration || 0, size, isVideo);
|
||||
}
|
||||
} else {
|
||||
updateFileInfo(0, size, isVideo);
|
||||
}
|
||||
|
||||
if (isTextPost && file) {
|
||||
// Create reader
|
||||
const reader = new FileReader();
|
||||
// Handler for file reader
|
||||
reader.addEventListener('load', handleFileReaderLoaded);
|
||||
// Read file contents
|
||||
reader.readAsText(file);
|
||||
setCurrentFileType('text/markdown');
|
||||
} else {
|
||||
setPublishMode(PUBLISH_MODES.FILE);
|
||||
}
|
||||
|
||||
// Strip off extension and replace invalid characters
|
||||
if (!isStillEditing) {
|
||||
const fileWithoutExtension = path.parse(fileData.path).name;
|
||||
updatePublishForm({ name: parseName(fileWithoutExtension) });
|
||||
}
|
||||
},
|
||||
[handleFileReaderLoaded, isStillEditing, setPublishMode, updateFileInfo, updatePublishForm]
|
||||
);
|
||||
|
||||
// Since the filePath can be updated from outside this component
|
||||
// (for instance, when the user drags & drops a file), we need
|
||||
// to check for changes in the selected file using an effect.
|
||||
@@ -190,14 +99,10 @@ function PublishFile(props: Props) {
|
||||
if (!filePath) {
|
||||
return;
|
||||
}
|
||||
let cancelled = false;
|
||||
async function readSelectedFileDetails() {
|
||||
// Read the file to get the file's duration (if possible)
|
||||
// and offer transcoding it.
|
||||
const result = await ipcRenderer.invoke('get-file-details-from-path', filePath);
|
||||
if (cancelled) {
|
||||
return;
|
||||
}
|
||||
let file;
|
||||
if (result.buffer) {
|
||||
file = new File([result.buffer], result.name, {
|
||||
@@ -215,10 +120,7 @@ function PublishFile(props: Props) {
|
||||
processSelectedFile(fileData);
|
||||
}
|
||||
readSelectedFileDetails();
|
||||
return () => {
|
||||
cancelled = true;
|
||||
};
|
||||
}, [filePath, processSelectedFile]);
|
||||
}, [filePath]);
|
||||
|
||||
useEffect(() => {
|
||||
const isOptimizeAvail = currentFile && currentFile !== '' && isVid && ffmpegAvail;
|
||||
@@ -228,6 +130,10 @@ function PublishFile(props: Props) {
|
||||
updatePublishForm({ optimize: finalOptimizeState });
|
||||
}, [currentFile, filePath, isVid, ffmpegAvail, userOptimize, updatePublishForm]);
|
||||
|
||||
function updateFileInfo(duration, size, isvid) {
|
||||
updatePublishForm({ fileDur: duration, fileSize: size, fileVid: isvid });
|
||||
}
|
||||
|
||||
function getBitrate(size, duration) {
|
||||
const s = Number(size);
|
||||
const d = Number(duration);
|
||||
@@ -302,12 +208,89 @@ function PublishFile(props: Props) {
|
||||
}
|
||||
}
|
||||
|
||||
function parseName(newName) {
|
||||
let INVALID_URI_CHARS = new RegExp(regexInvalidURI, 'gu');
|
||||
return newName.replace(INVALID_URI_CHARS, '-');
|
||||
}
|
||||
|
||||
function handleTitleChange(event) {
|
||||
const title = event.target.value;
|
||||
// Update title
|
||||
updatePublishForm({ title });
|
||||
}
|
||||
|
||||
function handleFileReaderLoaded(event: ProgressEvent) {
|
||||
// See: https://github.com/facebook/flow/issues/3470
|
||||
if (event.target instanceof FileReader) {
|
||||
const text = event.target.result;
|
||||
updatePublishForm({ fileText: text });
|
||||
setPublishMode(PUBLISH_MODES.POST);
|
||||
}
|
||||
}
|
||||
|
||||
function processSelectedFile(fileData: FileData, clearName = true) {
|
||||
window.URL = window.URL || window.webkitURL;
|
||||
|
||||
// select file, start to select a new one, then cancel
|
||||
if (!fileData || fileData.error) {
|
||||
if (isStillEditing || !clearName) {
|
||||
updatePublishForm({ filePath: '' });
|
||||
} else {
|
||||
updatePublishForm({ filePath: '', name: '' });
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// if video, extract duration so we can warn about bitrate if (typeof file !== 'string')
|
||||
const file = fileData.file;
|
||||
// Check to see if it's a video and if mp4
|
||||
const contentType = fileData.mimeType && fileData.mimeType.split('/'); // get this from electron side
|
||||
const duration = fileData.duration;
|
||||
const size = fileData.size;
|
||||
const isVideo = contentType && contentType[0] === 'video';
|
||||
const isMp4 = contentType && contentType[1] === 'mp4';
|
||||
|
||||
let isTextPost = false;
|
||||
|
||||
if (contentType && contentType[0] === 'text') {
|
||||
isTextPost = contentType[1] === 'plain' || contentType[1] === 'markdown';
|
||||
setCurrentFileType(contentType.join('/'));
|
||||
} else if (path.parse(fileData.path).ext) {
|
||||
// If user's machine is missing a valid content type registration
|
||||
// for markdown content: text/markdown, file extension will be used instead
|
||||
const extension = path.parse(fileData.path).ext;
|
||||
isTextPost = MARKDOWN_FILE_EXTENSIONS.includes(extension);
|
||||
}
|
||||
|
||||
if (isVideo) {
|
||||
if (isMp4) {
|
||||
updateFileInfo(duration || 0, size, isVideo);
|
||||
} else {
|
||||
updateFileInfo(duration || 0, size, isVideo);
|
||||
}
|
||||
} else {
|
||||
updateFileInfo(0, size, isVideo);
|
||||
}
|
||||
|
||||
if (isTextPost && file) {
|
||||
// Create reader
|
||||
const reader = new FileReader();
|
||||
// Handler for file reader
|
||||
reader.addEventListener('load', handleFileReaderLoaded);
|
||||
// Read file contents
|
||||
reader.readAsText(file);
|
||||
setCurrentFileType('text/markdown');
|
||||
} else {
|
||||
setPublishMode(PUBLISH_MODES.FILE);
|
||||
}
|
||||
|
||||
// Strip off extension and replace invalid characters
|
||||
if (!isStillEditing) {
|
||||
const fileWithoutExtension = path.parse(fileData.path).name;
|
||||
updatePublishForm({ name: parseName(fileWithoutExtension) });
|
||||
}
|
||||
}
|
||||
|
||||
function handleFileChange(fileWithPath: FileWithPath) {
|
||||
if (fileWithPath) {
|
||||
updatePublishForm({ filePath: fileWithPath.path });
|
||||
|
||||
@@ -262,7 +262,7 @@ function PublishForm(props: Props) {
|
||||
if (publishing || publishSuccess) {
|
||||
clearPublish();
|
||||
}
|
||||
}, [clearPublish, publishing, publishSuccess]);
|
||||
}, [clearPublish]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!thumbnail) {
|
||||
@@ -363,7 +363,7 @@ function PublishForm(props: Props) {
|
||||
const newParams = new URLSearchParams();
|
||||
newParams.set(TYPE_PARAM, mode.toLowerCase());
|
||||
replace({ search: newParams.toString() });
|
||||
}, [mode, _uploadType, replace]);
|
||||
}, [mode, _uploadType]);
|
||||
|
||||
// @if TARGET='app'
|
||||
// Save file changes locally ( desktop )
|
||||
|
||||
@@ -87,7 +87,7 @@ export default function ReportContent(props: Props) {
|
||||
claim_ids: [claimId],
|
||||
});
|
||||
}
|
||||
}, [claim, claimId, doClaimSearch]);
|
||||
}, [claim, claimId]);
|
||||
|
||||
// On mount, pause player and get the timestamp, if applicable.
|
||||
React.useEffect(() => {
|
||||
@@ -102,7 +102,7 @@ export default function ReportContent(props: Props) {
|
||||
const str = (n) => n.toLocaleString('en-US', { minimumIntegerDigits: 2, useGrouping: false });
|
||||
updateInput('timestamp', str(h) + ':' + str(m) + ':' + str(s));
|
||||
}
|
||||
}, [updateInput]);
|
||||
}, []);
|
||||
|
||||
React.useEffect(() => {
|
||||
let timer;
|
||||
|
||||
@@ -196,7 +196,7 @@ function RepostCreate(props: Props) {
|
||||
if (repostTakeoverAmount) {
|
||||
setAutoRepostBid(repostTakeoverAmount);
|
||||
}
|
||||
}, [setAutoRepostBid, enteredRepostAmount, passedRepostAmount]);
|
||||
}, [enteredRepostAmount, passedRepostAmount]);
|
||||
|
||||
// repost bid error
|
||||
React.useEffect(() => {
|
||||
@@ -211,7 +211,7 @@ function RepostCreate(props: Props) {
|
||||
rBidError = __('Your deposit must be higher');
|
||||
}
|
||||
setRepostBidError(rBidError);
|
||||
}, [balance, setRepostBidError, repostBidError, repostBid]);
|
||||
}, [setRepostBidError, repostBidError, repostBid]);
|
||||
|
||||
// setContentUri given enteredUri
|
||||
React.useEffect(() => {
|
||||
|
||||
@@ -67,7 +67,7 @@ const SearchOptions = (props: Props) => {
|
||||
if (options[SEARCH_OPTIONS.RESULT_COUNT] !== SEARCH_PAGE_SIZE) {
|
||||
setSearchOption(SEARCH_OPTIONS.RESULT_COUNT, SEARCH_PAGE_SIZE);
|
||||
}
|
||||
}, [options, setSearchOption]);
|
||||
}, []);
|
||||
|
||||
function updateSearchOptions(option, value) {
|
||||
setSearchOption(option, value);
|
||||
|
||||
@@ -33,7 +33,7 @@ type Props = {
|
||||
// For example, to only accept images pass the
|
||||
// following filter:
|
||||
// { name: 'Images', extensions: ['jpg', 'png', 'gif'] },
|
||||
filters?: Array<{ name: string, extensions: string[] }>,
|
||||
filters?: Array<{ name: string, extension: string[] }>,
|
||||
type?: string,
|
||||
};
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@ import SettingAppearance from './view';
|
||||
|
||||
const select = (state) => ({
|
||||
disableBackground: makeSelectClientSetting(SETTINGS.DISABLE_BACKGROUND)(state),
|
||||
backgroundMode: makeSelectClientSetting(SETTINGS.APP_BACKGROUND_MODE)(state),
|
||||
customBackgroundImage: makeSelectClientSetting(SETTINGS.CUSTOM_BACKGROUND_IMAGE)(state),
|
||||
clock24h: makeSelectClientSetting(SETTINGS.CLOCK_24H)(state),
|
||||
searchInLanguage: makeSelectClientSetting(SETTINGS.SEARCH_IN_LANGUAGE)(state),
|
||||
hideBalance: makeSelectClientSetting(SETTINGS.HIDE_BALANCE)(state),
|
||||
|
||||
@@ -4,8 +4,6 @@ import React from 'react';
|
||||
import * as SETTINGS from 'constants/settings';
|
||||
import Card from 'component/common/card';
|
||||
import { FormField } from 'component/common/form';
|
||||
import Button from 'component/button';
|
||||
import FileSelector from 'component/common/file-selector';
|
||||
import HomepageSelector from 'component/homepageSelector';
|
||||
import SettingLanguage from 'component/settingLanguage';
|
||||
import SettingsRow from 'component/settingsRow';
|
||||
@@ -15,8 +13,6 @@ import homepages from 'homepages';
|
||||
|
||||
type Props = {
|
||||
disableBackground: boolean,
|
||||
backgroundMode: string,
|
||||
customBackgroundImage: string,
|
||||
clock24h: boolean,
|
||||
searchInLanguage: boolean,
|
||||
hideBalance: boolean,
|
||||
@@ -25,29 +21,7 @@ type Props = {
|
||||
};
|
||||
|
||||
export default function SettingAppearance(props: Props) {
|
||||
const {
|
||||
clock24h,
|
||||
disableBackground,
|
||||
backgroundMode,
|
||||
customBackgroundImage,
|
||||
searchInLanguage,
|
||||
hideBalance,
|
||||
setClientSetting,
|
||||
setSearchInLanguage,
|
||||
} = props;
|
||||
|
||||
function handleBackgroundImageChosen(fileWithPath: FileWithPath) {
|
||||
const file = fileWithPath && fileWithPath.file;
|
||||
if (!file) return;
|
||||
|
||||
const reader = new FileReader();
|
||||
reader.onload = () => {
|
||||
if (reader.result) {
|
||||
setClientSetting(SETTINGS.CUSTOM_BACKGROUND_IMAGE, reader.result.toString());
|
||||
}
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
const { clock24h, disableBackground, searchInLanguage, hideBalance, setClientSetting, setSearchInLanguage } = props;
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -90,44 +64,6 @@ export default function SettingAppearance(props: Props) {
|
||||
checked={clock24h}
|
||||
/>
|
||||
</SettingsRow>
|
||||
<SettingsRow
|
||||
title={__('Background')}
|
||||
subtitle={__('Use a custom image or mirror the video that is currently playing.')}
|
||||
>
|
||||
<FormField
|
||||
type="select"
|
||||
name="app-background-mode"
|
||||
value={backgroundMode || SETTINGS.APP_BACKGROUND_MODES.DEFAULT}
|
||||
onChange={(e) => setClientSetting(SETTINGS.APP_BACKGROUND_MODE, e.target.value)}
|
||||
>
|
||||
<option value={SETTINGS.APP_BACKGROUND_MODES.DEFAULT}>{__('Default')}</option>
|
||||
<option value={SETTINGS.APP_BACKGROUND_MODES.CUSTOM}>{__('Custom image')}</option>
|
||||
<option value={SETTINGS.APP_BACKGROUND_MODES.VIDEO}>{__('Playing video')}</option>
|
||||
</FormField>
|
||||
</SettingsRow>
|
||||
{backgroundMode === SETTINGS.APP_BACKGROUND_MODES.CUSTOM && (
|
||||
<SettingsRow
|
||||
title={__('Custom background image')}
|
||||
subtitle={__('Choose an image to use as the app background.')}
|
||||
multirow
|
||||
>
|
||||
<FileSelector
|
||||
type="openFile"
|
||||
accept="image/*"
|
||||
filters={[{ name: __('Images'), extensions: ['jpg', 'jpeg', 'png', 'gif', 'webp', 'bmp'] }]}
|
||||
currentPath={customBackgroundImage ? __('Image selected') : undefined}
|
||||
label={__('Background image')}
|
||||
onFileChosen={handleBackgroundImageChosen}
|
||||
/>
|
||||
{customBackgroundImage && (
|
||||
<Button
|
||||
button="link"
|
||||
label={__('Remove custom background')}
|
||||
onClick={() => setClientSetting(SETTINGS.CUSTOM_BACKGROUND_IMAGE, '')}
|
||||
/>
|
||||
)}
|
||||
</SettingsRow>
|
||||
)}
|
||||
<SettingsRow title={__('Disable background')}>
|
||||
<FormField
|
||||
type="checkbox"
|
||||
|
||||
@@ -34,7 +34,7 @@ export default function SettingStorage(props: Props) {
|
||||
cleanBlobs().then(() => {
|
||||
setCleaning(false);
|
||||
});
|
||||
}, [cleanBlobs]);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -105,7 +105,7 @@ function SettingViewHosting(props: Props) {
|
||||
if (unlimited && viewHostingLimit !== 0) {
|
||||
handleApply();
|
||||
}
|
||||
}, [handleApply, unlimited, viewHostingLimit]);
|
||||
}, [unlimited, viewHostingLimit]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -73,27 +73,27 @@ function SettingWalletServer(props: Props) {
|
||||
doClear();
|
||||
}
|
||||
},
|
||||
[doClear]
|
||||
[]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (hasWalletServerPrefs) {
|
||||
setUsingCustomServer(true);
|
||||
}
|
||||
}, [hasWalletServerPrefs]);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const interval = setInterval(() => {
|
||||
getDaemonStatus();
|
||||
}, STATUS_INTERVAL);
|
||||
return () => clearInterval(interval);
|
||||
}, [getDaemonStatus]);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (walletRollbackToDefault) {
|
||||
doClear();
|
||||
}
|
||||
}, [doClear, walletRollbackToDefault]);
|
||||
}, [walletRollbackToDefault]);
|
||||
|
||||
useEffect(() => {
|
||||
if (usingCustomServer) {
|
||||
|
||||
@@ -89,14 +89,7 @@ const SupportsLiquidate = (props: Props) => {
|
||||
}
|
||||
setUnlockTextAmount(String(defaultValue));
|
||||
setDefaultValueAssigned(true);
|
||||
}, [
|
||||
defaultValue,
|
||||
defaultValueAssigned,
|
||||
previewBalance,
|
||||
unlockTextAmount,
|
||||
setUnlockTextAmount,
|
||||
setDefaultValueAssigned,
|
||||
]);
|
||||
}, [defaultValueAssigned, previewBalance, unlockTextAmount, setUnlockTextAmount, setDefaultValueAssigned]);
|
||||
|
||||
// Update message & error based on unlock amount.
|
||||
useEffect(() => {
|
||||
@@ -124,7 +117,7 @@ const SupportsLiquidate = (props: Props) => {
|
||||
setMessage(initialMessage);
|
||||
setError(false);
|
||||
}
|
||||
}, [initialMessage, unlockTextAmount, previewBalance, setMessage, setError]);
|
||||
}, [unlockTextAmount, previewBalance, setMessage, setError]);
|
||||
|
||||
return (
|
||||
<Card
|
||||
|
||||
@@ -34,8 +34,16 @@ const SHARED_KEY = 'shared';
|
||||
const LOCAL_KEY = 'local';
|
||||
|
||||
function SyncEnableFlow(props: Props) {
|
||||
const { setSyncEnabled, getSyncError, getSyncPending, getSync, checkSync, mode, closeModal, updatePreferences } =
|
||||
props;
|
||||
const {
|
||||
setSyncEnabled,
|
||||
getSyncError,
|
||||
getSyncPending,
|
||||
getSync,
|
||||
checkSync,
|
||||
mode,
|
||||
closeModal,
|
||||
updatePreferences,
|
||||
} = props;
|
||||
|
||||
const [step, setStep] = React.useState(INITIAL);
|
||||
const [prefDict, setPrefDict]: [any, (any) => void] = React.useState();
|
||||
@@ -110,7 +118,7 @@ function SyncEnableFlow(props: Props) {
|
||||
setStep(FETCH_FOR_DISABLE);
|
||||
}
|
||||
}
|
||||
}, [mode, setPassword, checkSync]);
|
||||
}, [mode, setPassword]);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (step === FETCH_FOR_ENABLE) {
|
||||
@@ -138,7 +146,7 @@ function SyncEnableFlow(props: Props) {
|
||||
setStep(CONFIRM);
|
||||
});
|
||||
}
|
||||
}, [step, setPrefDict, setStep, password, getSync]);
|
||||
}, [step, setPrefDict, setStep, password]);
|
||||
|
||||
if (getSyncPending) {
|
||||
return (
|
||||
|
||||
@@ -15,7 +15,7 @@ export default function TextareaSuggestionsItem(props: Props) {
|
||||
const { name: value, url, unicode } = emote;
|
||||
|
||||
return (
|
||||
<div {...autocompleteProps}>
|
||||
<div {...autocompleteProps} dispatch={undefined}>
|
||||
{unicode ? <div className="emote">{unicode}</div> : <img className="emote" src={url} />}
|
||||
|
||||
<div className="textareaSuggestion__label">
|
||||
@@ -31,7 +31,7 @@ export default function TextareaSuggestionsItem(props: Props) {
|
||||
const value = claim.canonical_url.replace('lbry://', '').replace('#', ':');
|
||||
|
||||
return (
|
||||
<div {...autocompleteProps}>
|
||||
<div {...autocompleteProps} dispatch={undefined}>
|
||||
<ChannelThumbnail xsmall uri={uri} />
|
||||
|
||||
<div className="textareaSuggestion__label">
|
||||
|
||||
@@ -56,7 +56,7 @@ function UserChannelFollowIntro(props: Props) {
|
||||
};
|
||||
setTimeout(delayedChannelSubscribe, 1000);
|
||||
}
|
||||
}, [prefsReady, channelSubscribe]);
|
||||
}, [prefsReady]);
|
||||
|
||||
return (
|
||||
<Card
|
||||
|
||||
@@ -87,7 +87,7 @@ function UserEmailNew(props: Props) {
|
||||
if (emailExists) {
|
||||
handleChangeToSignIn();
|
||||
}
|
||||
}, [emailExists, handleChangeToSignIn]);
|
||||
}, [emailExists]);
|
||||
|
||||
return (
|
||||
<div className={classnames('main__sign-up')}>
|
||||
|
||||
@@ -7,10 +7,10 @@ import Spinner from 'component/spinner';
|
||||
|
||||
type Props = {
|
||||
user: ?User,
|
||||
history: { push: (string) => void, replace: (string) => void },
|
||||
history: { push: string => void, replace: string => void },
|
||||
location: { search: string },
|
||||
userFetchPending: boolean,
|
||||
doUserSignIn: (string) => void,
|
||||
doUserSignIn: string => void,
|
||||
emailToVerify: ?string,
|
||||
passwordExists: boolean,
|
||||
};
|
||||
@@ -30,7 +30,7 @@ function UserSignIn(props: Props) {
|
||||
if (hasVerifiedEmail || (!showEmail && !showPassword && !showLoading)) {
|
||||
history.replace(redirect || '/');
|
||||
}
|
||||
}, [showEmail, showPassword, showLoading, hasVerifiedEmail, history, redirect]);
|
||||
}, [showEmail, showPassword, showLoading, hasVerifiedEmail]);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (emailToVerify && emailOnlyLogin) {
|
||||
|
||||
@@ -110,7 +110,7 @@ function UserSignUp(props: Props) {
|
||||
if (previousHasVerifiedEmail === false && hasVerifiedEmail && prefsReady) {
|
||||
setSettingAndSync(SETTINGS.FIRST_RUN_STARTED, true);
|
||||
}
|
||||
}, [hasVerifiedEmail, previousHasVerifiedEmail, prefsReady, setSettingAndSync]);
|
||||
}, [hasVerifiedEmail, previousHasVerifiedEmail, prefsReady]);
|
||||
|
||||
React.useEffect(() => {
|
||||
// Don't claim the reward if sync is enabled until after a sync has been completed successfully
|
||||
|
||||
@@ -157,7 +157,7 @@ const VideoJsEvents = ({
|
||||
.getChild('TheaterModeButton')
|
||||
.controlText(videoTheaterMode ? __('Default Mode (t)') : __('Theater Mode (t)'));
|
||||
}
|
||||
}, [videoTheaterMode, playerRef]);
|
||||
}, [videoTheaterMode]);
|
||||
|
||||
// when user clicks 'Unmute' button, turn audio on and hide unmute button
|
||||
function unmuteAndHideHint() {
|
||||
@@ -224,14 +224,14 @@ const VideoJsEvents = ({
|
||||
autoplayButton.setAttribute('aria-checked', autoplaySetting);
|
||||
}
|
||||
}
|
||||
}, [autoplaySetting, playerRef]);
|
||||
}, [autoplaySetting]);
|
||||
|
||||
useEffect(() => {
|
||||
const player = playerRef.current;
|
||||
if (replay && player) {
|
||||
player.play();
|
||||
}
|
||||
}, [replay, playerRef]);
|
||||
}, [replay]);
|
||||
|
||||
function initializeEvents() {
|
||||
const player = playerRef.current;
|
||||
|
||||
@@ -128,7 +128,6 @@ export default React.memo<Props>(function VideoJs(props: Props) {
|
||||
|
||||
const tapToUnmuteRef = useRef();
|
||||
const tapToRetryRef = useRef();
|
||||
const keydownHandler = useRef(null);
|
||||
|
||||
// initiate keyboard shortcuts
|
||||
const { curried_function } = keyboardShorcuts({ toggleVideoTheaterMode, playNext, playPrevious });
|
||||
@@ -233,16 +232,12 @@ export default React.memo<Props>(function VideoJs(props: Props) {
|
||||
// Set reference in component state
|
||||
playerRef.current = vjsPlayer;
|
||||
|
||||
keydownHandler.current = curried_function(playerRef, containerRef);
|
||||
window.addEventListener('keydown', keydownHandler.current);
|
||||
window.addEventListener('keydown', curried_function(playerRef, containerRef));
|
||||
});
|
||||
|
||||
// Cleanup
|
||||
return () => {
|
||||
if (keydownHandler.current) {
|
||||
window.removeEventListener('keydown', keydownHandler.current);
|
||||
keydownHandler.current = null;
|
||||
}
|
||||
window.removeEventListener('keydown', curried_function);
|
||||
|
||||
const player = playerRef.current;
|
||||
if (player) {
|
||||
@@ -250,12 +245,6 @@ export default React.memo<Props>(function VideoJs(props: Props) {
|
||||
window.player = undefined;
|
||||
}
|
||||
};
|
||||
// These dep-array entries are intentionally only [isAudio, source]: the DOM/player is
|
||||
// recreated from scratch only when the medium or the source changes. initializeVideoPlayer,
|
||||
// createVideoPlayerDOM, detectFileType and curried_function are recreated on each render
|
||||
// (unstable identity), so adding them here would destroy/recreate the player on every
|
||||
// render, stacking one <video> element + one player per pass.
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [isAudio, source]);
|
||||
|
||||
// Update video player and reload when source URL changes
|
||||
|
||||
@@ -5,8 +5,6 @@ import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
|
||||
const select = (state) => ({
|
||||
disableBackground: makeSelectClientSetting(SETTINGS.DISABLE_BACKGROUND)(state),
|
||||
backgroundMode: makeSelectClientSetting(SETTINGS.APP_BACKGROUND_MODE)(state),
|
||||
customBackgroundImage: makeSelectClientSetting(SETTINGS.CUSTOM_BACKGROUND_IMAGE)(state),
|
||||
});
|
||||
|
||||
const perform = {};
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import { APP_BACKGROUND_MODES } from 'constants/settings';
|
||||
// import { resetColors } from 'util/theme';
|
||||
// $FlowFixMe cannot resolve ...
|
||||
import freeezepeach from 'static/img/freespch.png';
|
||||
@@ -10,65 +9,10 @@ type Props = {
|
||||
// avatar: ?string,
|
||||
reset: ?boolean,
|
||||
disableBackground: ?boolean,
|
||||
backgroundMode: ?string,
|
||||
customBackgroundImage: ?string,
|
||||
};
|
||||
|
||||
const VideoBackground = () => {
|
||||
const canvasRef = React.useRef<any>();
|
||||
|
||||
React.useEffect(() => {
|
||||
const canvas = canvasRef.current;
|
||||
if (!canvas) return;
|
||||
|
||||
const context = canvas.getContext('2d');
|
||||
if (!context) return;
|
||||
|
||||
let animationFrame;
|
||||
let lastDrawTime = 0;
|
||||
|
||||
function draw(timestamp) {
|
||||
animationFrame = window.requestAnimationFrame(draw);
|
||||
|
||||
if (timestamp - lastDrawTime < 33) return;
|
||||
lastDrawTime = timestamp;
|
||||
|
||||
const video: ?HTMLVideoElement =
|
||||
(document.querySelector('video.vjs-tech'): any) || (document.querySelector('video.video-js'): any);
|
||||
|
||||
if (video && video.videoWidth && video.videoHeight) {
|
||||
const width = window.innerWidth;
|
||||
const height = window.innerHeight;
|
||||
|
||||
if (canvas.width !== width || canvas.height !== height) {
|
||||
canvas.width = width;
|
||||
canvas.height = height;
|
||||
}
|
||||
|
||||
const scale = Math.max(width / video.videoWidth, height / video.videoHeight);
|
||||
const drawWidth = video.videoWidth * scale;
|
||||
const drawHeight = video.videoHeight * scale;
|
||||
const x = (width - drawWidth) / 2;
|
||||
const y = (height - drawHeight) / 2;
|
||||
|
||||
try {
|
||||
context.drawImage(video, x, y, drawWidth, drawHeight);
|
||||
} catch (e) {}
|
||||
} else if (canvas.width && canvas.height) {
|
||||
context.clearRect(0, 0, canvas.width, canvas.height);
|
||||
}
|
||||
}
|
||||
|
||||
animationFrame = window.requestAnimationFrame(draw);
|
||||
|
||||
return () => window.cancelAnimationFrame(animationFrame);
|
||||
}, []);
|
||||
|
||||
return <canvas ref={canvasRef} className="background-video" />;
|
||||
};
|
||||
|
||||
const Wallpaper = (props: Props) => {
|
||||
const { disableBackground, backgroundMode, customBackgroundImage } = props;
|
||||
const { disableBackground } = props;
|
||||
|
||||
/*
|
||||
if (avatar) {
|
||||
@@ -285,19 +229,14 @@ const Wallpaper = (props: Props) => {
|
||||
/>
|
||||
*/
|
||||
|
||||
const isVideoBackground = !disableBackground && backgroundMode === APP_BACKGROUND_MODES.VIDEO;
|
||||
const backgroundImage =
|
||||
backgroundMode === APP_BACKGROUND_MODES.CUSTOM && customBackgroundImage ? customBackgroundImage : freeezepeach;
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
className={'background-image'}
|
||||
style={{
|
||||
backgroundImage: disableBackground ? 'none' : `url("${backgroundImage}")`,
|
||||
backgroundImage: disableBackground ? `none` : `url(${freeezepeach})`,
|
||||
}}
|
||||
/>
|
||||
{isVideoBackground && <VideoBackground />}
|
||||
<div className={'theme'} />
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -15,14 +15,6 @@ export const THEMES = 'themes';
|
||||
export const AUTOMATIC_DARK_MODE_ENABLED = 'automatic_dark_mode_enabled';
|
||||
export const CLOCK_24H = 'clock_24h';
|
||||
export const DISABLE_BACKGROUND = 'disableBackground';
|
||||
export const APP_BACKGROUND_MODE = 'app_background_mode';
|
||||
export const CUSTOM_BACKGROUND_IMAGE = 'custom_background_image';
|
||||
|
||||
export const APP_BACKGROUND_MODES = {
|
||||
DEFAULT: 'default',
|
||||
CUSTOM: 'custom',
|
||||
VIDEO: 'video',
|
||||
};
|
||||
export const AUTOPLAY_MEDIA = 'autoplay';
|
||||
export const AUTOPLAY_NEXT = 'autoplay_next';
|
||||
export const OS_NOTIFICATIONS_ENABLED = 'os_notifications_enabled';
|
||||
|
||||
@@ -24,5 +24,5 @@ export default function useHistoryNav(history) {
|
||||
window.addEventListener('keydown', handleKeyPress);
|
||||
}
|
||||
return () => window.removeEventListener('keydown', handleKeyPress);
|
||||
}, [el, history]);
|
||||
}, [el]);
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ export default function useLazyLoading(
|
||||
|
||||
// $FlowFixMe
|
||||
lazyLoadingObserver.observe(elementRef.current);
|
||||
}, [backgroundFallback, elementRef, yOffsetPx]);
|
||||
}, deps);
|
||||
|
||||
return srcLoaded;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ function ModalAffirmPurchase(props: Props) {
|
||||
clearTimeout(timeout);
|
||||
}
|
||||
};
|
||||
}, [success, uri, closeModal]);
|
||||
}, [success, uri]);
|
||||
|
||||
return (
|
||||
<Modal type="card" isOpen contentLabel={modalTitle} onAborted={cancelPurchase}>
|
||||
|
||||
@@ -92,11 +92,11 @@ function FileListPublished(props: Props) {
|
||||
params.set('searchText', searchText);
|
||||
history.replace('?' + params.toString());
|
||||
debounceFilter();
|
||||
}, [myClaims, searchText, debounceFilter, history, search]);
|
||||
}, [myClaims, searchText]);
|
||||
|
||||
useEffect(() => {
|
||||
doFilterClaims();
|
||||
}, [myClaims, filterBy, doFilterClaims]);
|
||||
}, [myClaims, filterBy]);
|
||||
|
||||
const urlTotal = filteredClaims.length;
|
||||
|
||||
@@ -118,7 +118,7 @@ function FileListPublished(props: Props) {
|
||||
const params = new URLSearchParams(search);
|
||||
params.set(PAGINATE_PARAM, '1');
|
||||
history.replace('?' + params.toString());
|
||||
}, [filteredClaims, history, search]);
|
||||
}, [filteredClaims]);
|
||||
|
||||
useEffect(() => {
|
||||
fetchAllMyClaims();
|
||||
|
||||
@@ -77,7 +77,7 @@ export default function NotificationsPage(props: Props) {
|
||||
// If there are unread notifications when entering the page, reset to All.
|
||||
setName(NOTIFICATIONS.NOTIFICATION_NAME_ALL);
|
||||
}
|
||||
}, [setName, unreadCount, unseenCount]);
|
||||
}, []);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (unseenCount > 0) {
|
||||
@@ -104,7 +104,7 @@ export default function NotificationsPage(props: Props) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}, [name, notifications, stringifiedNotificationCategories, doNotificationList]);
|
||||
}, [name, notifications, stringifiedNotificationCategories]);
|
||||
|
||||
const notificationListElement = (
|
||||
<>
|
||||
|
||||
@@ -53,7 +53,7 @@ export default function NotificationSettingsPage(props: Props) {
|
||||
setError(true);
|
||||
});
|
||||
}
|
||||
}, [lbryIoParams, isAuthenticated]);
|
||||
}, [isAuthenticated]);
|
||||
|
||||
function handleChangeTag(name, newIsEnabled) {
|
||||
const tagParams = newIsEnabled ? { add: name } : { remove: name };
|
||||
|
||||
@@ -39,13 +39,13 @@ function SignInVerifyPage(props: Props) {
|
||||
if (!authToken || !userSubmittedEmail || !verificationToken) {
|
||||
onAuthError(__('Invalid or expired sign-in link.'));
|
||||
}
|
||||
}, [onAuthError, authToken, userSubmittedEmail, verificationToken, doToast, push]);
|
||||
}, [authToken, userSubmittedEmail, verificationToken, doToast, push]);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!needsRecaptcha) {
|
||||
verifyUser();
|
||||
}
|
||||
}, [verifyUser, needsRecaptcha]);
|
||||
}, [needsRecaptcha]);
|
||||
|
||||
React.useEffect(() => {
|
||||
let captchaTimeout;
|
||||
|
||||
@@ -41,8 +41,6 @@ const defaultState = {
|
||||
[SETTINGS.AUTOMATIC_DARK_MODE_ENABLED]: false,
|
||||
[SETTINGS.CLOCK_24H]: false,
|
||||
[SETTINGS.DISABLE_BACKGROUND]: false,
|
||||
[SETTINGS.APP_BACKGROUND_MODE]: SETTINGS.APP_BACKGROUND_MODES.DEFAULT,
|
||||
[SETTINGS.CUSTOM_BACKGROUND_IMAGE]: '',
|
||||
[SETTINGS.TILE_LAYOUT]: true,
|
||||
[SETTINGS.VIDEO_THEATER_MODE]: false,
|
||||
[SETTINGS.VIDEO_PLAYBACK_RATE]: 1,
|
||||
|
||||
@@ -577,18 +577,6 @@ img {
|
||||
-webkit-filter: blur(23px);
|
||||
}
|
||||
|
||||
.background-video {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
filter: blur(23px);
|
||||
-webkit-filter: blur(23px);
|
||||
}
|
||||
|
||||
.theme {
|
||||
position: fixed;
|
||||
left: 0px;
|
||||
|
||||
@@ -6,7 +6,6 @@ import SUPPORTED_LANGUAGES from 'constants/supported_languages';
|
||||
import { parseURI } from 'util/lbryURI';
|
||||
import moment from 'moment';
|
||||
import { toCapitalCase } from 'util/string';
|
||||
import { CUSTOM_HOMEPAGE } from 'config';
|
||||
|
||||
export type RowDataItem = {
|
||||
title: any,
|
||||
@@ -167,8 +166,7 @@ export function GetLinksData(
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// @_if CUSTOM_HOMEPAGE='false'
|
||||
// TODO Renable
|
||||
// @if 'true'
|
||||
|
||||
/*
|
||||
const YOUTUBER_CHANNEL_IDS = [
|
||||
@@ -302,7 +300,7 @@ export function GetLinksData(
|
||||
},
|
||||
};
|
||||
|
||||
if (isHomepage && !CUSTOM_HOMEPAGE) {
|
||||
if (isHomepage && true) {
|
||||
if (followedTags) {
|
||||
const TRENDING_FOR_TAGS = {
|
||||
title: __('Trending For Your Tags'),
|
||||
@@ -337,7 +335,7 @@ export function GetLinksData(
|
||||
}
|
||||
}
|
||||
|
||||
if (!CUSTOM_HOMEPAGE) {
|
||||
if (true) {
|
||||
rowData.push(TOP_CONTENT_TODAY);
|
||||
if (language !== 'en') {
|
||||
rowData.push(LANGUAGE_CATEGORY);
|
||||
@@ -346,7 +344,7 @@ export function GetLinksData(
|
||||
if (!showPersonalizedChannels) rowData.push(TOP_CHANNELS);
|
||||
}
|
||||
|
||||
// @_endif
|
||||
// @endif
|
||||
// **************************************************************************
|
||||
|
||||
// TODO: provide better method for exempting from homepage
|
||||
|
||||
@@ -46,7 +46,7 @@ let baseConfig = {
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
postcssOptions: {
|
||||
plugins: function() {
|
||||
plugins: function () {
|
||||
return [require('postcss-rtl')()];
|
||||
},
|
||||
},
|
||||
@@ -93,7 +93,7 @@ let baseConfig = {
|
||||
'lodash.isempty': 'lodash-es/isEmpty',
|
||||
'lodash.forin': 'lodash-es/forIn',
|
||||
'lodash.clonedeep': 'lodash-es/cloneDeep',
|
||||
'react/jsx-runtime': 'react/jsx-runtime.js',
|
||||
'react/jsx-runtime': 'react/jsx-runtime.js',
|
||||
...ifProduction({}, { 'react-dom': '@hot-loader/react-dom' }),
|
||||
},
|
||||
symlinks: false,
|
||||
@@ -102,7 +102,7 @@ let baseConfig = {
|
||||
plugins: [
|
||||
new webpack.IgnorePlugin({ resourceRegExp: /^\.\/locale$/, contextRegExp: /moment$/ }),
|
||||
new webpack.EnvironmentPlugin({
|
||||
NODE_ENV: 'development', // default value if NODE_ENV is not defined
|
||||
NODE_ENV: 'development' // default value if NODE_ENV is not defined
|
||||
}),
|
||||
new DefinePlugin({
|
||||
__static: `"${path.join(__dirname, 'static').replace(/\\/g, '\\\\')}"`,
|
||||
|
||||
@@ -13,7 +13,7 @@ let mainConfig = {
|
||||
},
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
path: path.resolve(__dirname,'dist/electron/webpack'),
|
||||
path: __dirname + '/dist/electron/webpack',
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
@@ -92,7 +92,7 @@ const renderConfig = {
|
||||
},
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
path: path.resolve(__dirname,'dist/electron/webpack'),
|
||||
path: __dirname + '/dist/electron/webpack',
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
|
||||
Reference in New Issue
Block a user