flow fixes

This commit is contained in:
Sean Yesmunt 2020-12-01 12:56:59 -05:00
parent 124f5ad331
commit 0cc3af28a3
30 changed files with 210 additions and 1070 deletions

1
.eslintignore Normal file
View file

@ -0,0 +1 @@
./web/node_modules/*

View file

@ -14,6 +14,11 @@
"IS_WEB": true,
"WEBPACK_PORT": true
},
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"brace-style": 0,
"camelcase": 0,

View file

@ -5,26 +5,31 @@ name: Node.js CI
on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]
jobs:
build:
lint:
name: 'lint'
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v2
- uses: Borales/actions-yarn@v2.3.0
- run: yarn lint
build:
needs: ['lint']
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
node-version: [12.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: GitHub Action for Yarn
uses: Borales/actions-yarn@v2.3.0
- run: yarn
- run: NODE_ENV=production yarn compile:web
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
with:
node-version: ${{ matrix.node-version }}
- run: |
NODE_ENV=production yarn compile:web

View file

@ -1,80 +0,0 @@
matrix:
include:
- os: osx
env: TARGET=mac
osx_image: xcode10
language: node_js
node_js: '10'
- os: linux
env: TARGET=windows
services: docker
language: node_js
node_js: '10'
- os: linux
env: TARGET=linux
language: node_js
node_js: '10'
cache: false
before_install:
- |
unset TRAVIS_COMMIT_MESSAGE;
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v2.3.1/git-lfs-$([ "$TRAVIS_OS_NAME" == "linux" ] && echo "linux" || echo "darwin")-amd64-2.3.1.tar.gz | tar -xz -C /tmp/git-lfs --strip-components 1
export PATH="/tmp/git-lfs:$PATH"
else
sudo apt-get -qq update
sudo apt-get install --no-install-recommends -y gcc-multilib g++-multilib wget
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.6.0
export PATH="$HOME/.yarn/bin:$PATH"
fi
before_script:
- git lfs pull
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then unset WIN_CSC_LINK; unset CSC_LINK; fi
- wget https://headers.lbry.io/blockchain_headers_latest -O $TRAVIS_BUILD_DIR/static/daemon/headers
script:
- travis_wait 30
- |
if [ "$TARGET" == "windows" ]; then
# Remove any special characters before adding to our list of ENVs
# https://github.com/electron-userland/electron-builder/issues/2450#issuecomment-421788155
ENVS=`env | grep -iE '(DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS|APPVEYOR_|CSC_|_TOKEN|_KEY|AWS_|STRIP|BUILD_|TARGET)([A-Z]|_)*=' | sed -n '/^[^\t]/s/=.*//p' | sed '/^$/d' | sed 's/^/-e /g' | tr '\n' ' '`
docker run $ENVS --rm \
-v ${PWD}:/project \
electronuserland/builder:wine \
/bin/bash -c "env | grep -v '\r' | grep -iE 'DEBUG|TARGET|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS|APPVEYOR_|CSC_|GH_|GITHUB_|BT_|AWS_|STRIP|BUILD_|WIN_' && yarn --link-duplicates --pure-lockfile && yarn build --win --publish onTag";
fi
- if [ "$TARGET" == "mac" ]; then yarn build --publish onTag; fi
- if [ "$TARGET" == "linux" ]; then yarn --link-duplicates --pure-lockfile && yarn
build --linux --publish onTag; fi
addons:
artifacts:
working_dir: dist
paths:
- $(git ls-files -o dist/{*.dmg,*.exe,*.deb,*.AppImage} | tr "\n" ":")
target_paths:
- '/app/build-${TRAVIS_BUILD_NUMBER}_commit-${TRAVIS_COMMIT:0:7}$([ ! -z ${TRAVIS_TAG}
] && echo _tag-${TRAVIS_TAG})'
env:
global:
- ENABLE_COMMENT_REACTIONS=true
- SHARE_DOMAIN_URL=https://open.lbry.com
- ARTIFACTS_REGION=us-east-1
- ARTIFACTS_BUCKET=build.lbry.io
- DANGER_GITHUB_API_TOKEN=f8b612049cbda985c251e18ae36c7a2b9c6c92df
- ARTIFACTS_DEBUG=1
- WIN_CSC_LINK=https://s3.amazonaws.com/files.lbry.io/cert/win-csc-2020-2021-08.p12
- CSC_LINK=https://s3.amazonaws.com/files.lbry.io/cert/osx-cert.p12
#AWS_SECRET_ACCESS_KEY
- secure: aF0dZ1ub0r6X5SaTH7YYRpV8cl2gkU2tA7y2tkvGZQL0+Vv2FvkhwaXREa9IM9djm7r3W7I8vEekk6Skn300kIBwQ04COxgu+Oeqjsc2a529wmF9AN5EwKExKkVQFIjMjpMBmd/fE05PD29C0vULdtIMX8uhDe5zFE+tGD1QmwKVZ+55oCxJmt7vsQwQr46s/BsPODrZhvSUPWTUG4HSsc5DJwe/XYY+35vWQsnpCkBVabAZg+lnOpqLioRNzTsBX1oSkqTX9uvOC6fN+NlpbJWetzXsBciFcMHQCx9UHxu+Ibn3W3V8FVYRuFLAinhIg+JoVQHU8mH60ggjizATpgx12riP9e/Uwho5x5bgIYmnIBf4AHqupPv40iC/THMvsS08hCQHicu+/WiAvvN8wNQ1sqpj0+RTreB+4/qdRdwTs70t4jNV83cP+nAuekMCC7uYQ08GLmFNaa+x8NgDZa3JQv7EmXU0ALWVPeJ9UEV+dhEs5iI+7bLEhTUOuvBBWo17F4pst3pfS1j7md1x4wKFRWyP7IFmjK+L1KiAH94c/LIz2Nlp5yCDfbcwU5W/wCHYAxu5c8qnAlkxeub0GpxtZ66j6oOehk1lsHYxaZcBxyn7XhM1A6Mjxgy9OG0WGyYun8iH3aa4WcY0BO21l7je75s7l0qNSRS80st8kUE=
#AWS_ACCESS_KEY_ID
- secure: HHlUGaEjk0qsW9qb/93jdFhJypiDuJ0e6Z4UClW3ciMfdZ22Ur4D0oL0mgVguigTjdkf1Yy4Z1kWtWvtvQ8DBI+mdOl5GTMpX5nMattcuK/4gFXmqz30S3c07IPkilGKkAT64JqRGT7AvQTaV/tXqNN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Ek084o6ciJ2JjqEhXvXOCeRJ2I9cf2dEk7CvtbitiDly6XATo2FP4hqNdcNNWyj/jFvuTwFT6hzBqLk1BCBc=
#WIN_CSC_KEY_PASSWORD
- secure: 'mNq+gElkt2fRFdttUK8JhLl0+tk8qUOO25J/h1hDx3juEkE4gnSGWAWbEchc1abqODH+bHLOdARdexrdNmAD7ZXbvbcZdaZt8kk9azVnV7+61sPheA5/qaln1mxps+jiI2wmfERmNsis1NAFLeMioVF9H6rRCbgRf8Vth2JHDqzygW6c9KEDhTCJqV9QV3FYL7onLGLChKvtddRqYSBEqnJxpyY+Tf6fP8DykCzWvhV9Pur2yioF/10FC0fdnzgmkA3iTMwaXkVNuVcIK9u+pN10w5t6eyriORgDpWhE4LZWBoCraSA0Pv4X6ZAnhSXND/b2acVzdKJRKEO3/ajS9LCokwW/lk7/OS5+A3JBJh+aIepG1yZFhyPEnQX+BnOAzdH20QxQXZmCYEbc0XrL3NVgNBfrp7nE/B04/cRj19PQTjRV71+KB2Rvz4kNqnWist8Lr3V4uql7q8DKl4v/XzzjZw9LYIGtXmGXzoA6jveFX3UkiBHy1Sa+ESqkN9rNBZcPwhoOogxGDk01rLkBguQKmh/flTqfOvt2TJqUmyeJg3ymsGgLq6jkwinTzWa5u1enL6TmKDOHkgLtzGj9fqDcC+Wo6kxo97lKWt8uhYssMXdsUSHF5IfJOvO4sTPVkn2bYXDTtyWovmY4jt6Quthu60o+QlMp9x/AT1GvDZc='

View file

@ -1,13 +0,0 @@
FROM node:10
EXPOSE 1337
RUN yarn -v && npm -v
RUN apt-get update -y && apt-get upgrade -y
WORKDIR /app
ENV PATH="/app/node_modules/.bin:${PATH}"
COPY ./ ./
RUN rm -rf node_modules && APP_ENV=web yarn && SDK_API_URL='https://api.lbry.tv/api/proxy' NODE_ENV=production yarn compile:web --display errors-only
CMD node ./dist/web/server.js

View file

@ -1,2 +0,0 @@
- name: Danger JS Action
uses: danger/danger-js@9.1.8

View file

@ -1,9 +0,0 @@
import { danger, warn } from 'danger';
// Check for a CHANGELOG entry
const hasChangelog = danger.git.modified_files.some(f => f === 'CHANGELOG.md');
if (!hasChangelog) {
const title = ':page_facing_up: Changelog Entry Missing';
const idea = 'Please add a changelog entry for your changes.';
warn(`${title} - <i>${idea}</i>`);
}

View file

@ -1,5 +1,5 @@
import { app, Menu, shell } from 'electron';
import { changeZoomFactor, ZOOM } from 'util/zoomWindow';
import { ZOOM } from 'util/zoomWindow';
export default () => {
const template = [

View file

@ -1,270 +0,0 @@
// flow-typed signature: ffdd57cb6a0c6f4b1d0b68538d77fd53
// flow-typed version: <<STUB>>/node-sass_v^4.11.0/flow_v0.94.0
/**
* This is an autogenerated libdef stub for:
*
* 'node-sass'
*
* Fill this stub out by replacing all the `any` types.
*
* Once filled out, we encourage you to share your work with the
* community by sending a pull request to:
* https://github.com/flowtype/flow-typed
*/
declare module 'node-sass' {
declare module.exports: any;
}
/**
* We include stubs for each file inside this npm package in case you need to
* require those files directly. Feel free to delete any files that aren't
* needed.
*/
declare module 'node-sass/lib/binding' {
declare module.exports: any;
}
declare module 'node-sass/lib/errors' {
declare module.exports: any;
}
declare module 'node-sass/lib/extensions' {
declare module.exports: any;
}
declare module 'node-sass/lib/index' {
declare module.exports: any;
}
declare module 'node-sass/lib/render' {
declare module.exports: any;
}
declare module 'node-sass/lib/watcher' {
declare module.exports: any;
}
declare module 'node-sass/scripts/build' {
declare module.exports: any;
}
declare module 'node-sass/scripts/coverage' {
declare module.exports: any;
}
declare module 'node-sass/scripts/install' {
declare module.exports: any;
}
declare module 'node-sass/scripts/prepublish' {
declare module.exports: any;
}
declare module 'node-sass/scripts/util/downloadoptions' {
declare module.exports: any;
}
declare module 'node-sass/scripts/util/proxy' {
declare module.exports: any;
}
declare module 'node-sass/scripts/util/useragent' {
declare module.exports: any;
}
declare module 'node-sass/test/api' {
declare module.exports: any;
}
declare module 'node-sass/test/binding' {
declare module.exports: any;
}
declare module 'node-sass/test/cli' {
declare module.exports: any;
}
declare module 'node-sass/test/downloadoptions' {
declare module.exports: any;
}
declare module 'node-sass/test/errors' {
declare module.exports: any;
}
declare module 'node-sass/test/fixtures/extras/my_custom_arrays_of_importers' {
declare module.exports: any;
}
declare module 'node-sass/test/fixtures/extras/my_custom_functions_setter' {
declare module.exports: any;
}
declare module 'node-sass/test/fixtures/extras/my_custom_functions_string_conversion' {
declare module.exports: any;
}
declare module 'node-sass/test/fixtures/extras/my_custom_importer_data_cb' {
declare module.exports: any;
}
declare module 'node-sass/test/fixtures/extras/my_custom_importer_data' {
declare module.exports: any;
}
declare module 'node-sass/test/fixtures/extras/my_custom_importer_error' {
declare module.exports: any;
}
declare module 'node-sass/test/fixtures/extras/my_custom_importer_file_and_data_cb' {
declare module.exports: any;
}
declare module 'node-sass/test/fixtures/extras/my_custom_importer_file_and_data' {
declare module.exports: any;
}
declare module 'node-sass/test/fixtures/extras/my_custom_importer_file_cb' {
declare module.exports: any;
}
declare module 'node-sass/test/fixtures/extras/my_custom_importer_file' {
declare module.exports: any;
}
declare module 'node-sass/test/lowlevel' {
declare module.exports: any;
}
declare module 'node-sass/test/runtime' {
declare module.exports: any;
}
declare module 'node-sass/test/scripts/util/proxy' {
declare module.exports: any;
}
declare module 'node-sass/test/spec' {
declare module.exports: any;
}
declare module 'node-sass/test/types' {
declare module.exports: any;
}
declare module 'node-sass/test/useragent' {
declare module.exports: any;
}
declare module 'node-sass/test/watcher' {
declare module.exports: any;
}
// Filename aliases
declare module 'node-sass/lib/binding.js' {
declare module.exports: $Exports<'node-sass/lib/binding'>;
}
declare module 'node-sass/lib/errors.js' {
declare module.exports: $Exports<'node-sass/lib/errors'>;
}
declare module 'node-sass/lib/extensions.js' {
declare module.exports: $Exports<'node-sass/lib/extensions'>;
}
declare module 'node-sass/lib/index.js' {
declare module.exports: $Exports<'node-sass/lib/index'>;
}
declare module 'node-sass/lib/render.js' {
declare module.exports: $Exports<'node-sass/lib/render'>;
}
declare module 'node-sass/lib/watcher.js' {
declare module.exports: $Exports<'node-sass/lib/watcher'>;
}
declare module 'node-sass/scripts/build.js' {
declare module.exports: $Exports<'node-sass/scripts/build'>;
}
declare module 'node-sass/scripts/coverage.js' {
declare module.exports: $Exports<'node-sass/scripts/coverage'>;
}
declare module 'node-sass/scripts/install.js' {
declare module.exports: $Exports<'node-sass/scripts/install'>;
}
declare module 'node-sass/scripts/prepublish.js' {
declare module.exports: $Exports<'node-sass/scripts/prepublish'>;
}
declare module 'node-sass/scripts/util/downloadoptions.js' {
declare module.exports: $Exports<'node-sass/scripts/util/downloadoptions'>;
}
declare module 'node-sass/scripts/util/proxy.js' {
declare module.exports: $Exports<'node-sass/scripts/util/proxy'>;
}
declare module 'node-sass/scripts/util/useragent.js' {
declare module.exports: $Exports<'node-sass/scripts/util/useragent'>;
}
declare module 'node-sass/test/api.js' {
declare module.exports: $Exports<'node-sass/test/api'>;
}
declare module 'node-sass/test/binding.js' {
declare module.exports: $Exports<'node-sass/test/binding'>;
}
declare module 'node-sass/test/cli.js' {
declare module.exports: $Exports<'node-sass/test/cli'>;
}
declare module 'node-sass/test/downloadoptions.js' {
declare module.exports: $Exports<'node-sass/test/downloadoptions'>;
}
declare module 'node-sass/test/errors.js' {
declare module.exports: $Exports<'node-sass/test/errors'>;
}
declare module 'node-sass/test/fixtures/extras/my_custom_arrays_of_importers.js' {
declare module.exports: $Exports<'node-sass/test/fixtures/extras/my_custom_arrays_of_importers'>;
}
declare module 'node-sass/test/fixtures/extras/my_custom_functions_setter.js' {
declare module.exports: $Exports<'node-sass/test/fixtures/extras/my_custom_functions_setter'>;
}
declare module 'node-sass/test/fixtures/extras/my_custom_functions_string_conversion.js' {
declare module.exports: $Exports<'node-sass/test/fixtures/extras/my_custom_functions_string_conversion'>;
}
declare module 'node-sass/test/fixtures/extras/my_custom_importer_data_cb.js' {
declare module.exports: $Exports<'node-sass/test/fixtures/extras/my_custom_importer_data_cb'>;
}
declare module 'node-sass/test/fixtures/extras/my_custom_importer_data.js' {
declare module.exports: $Exports<'node-sass/test/fixtures/extras/my_custom_importer_data'>;
}
declare module 'node-sass/test/fixtures/extras/my_custom_importer_error.js' {
declare module.exports: $Exports<'node-sass/test/fixtures/extras/my_custom_importer_error'>;
}
declare module 'node-sass/test/fixtures/extras/my_custom_importer_file_and_data_cb.js' {
declare module.exports: $Exports<'node-sass/test/fixtures/extras/my_custom_importer_file_and_data_cb'>;
}
declare module 'node-sass/test/fixtures/extras/my_custom_importer_file_and_data.js' {
declare module.exports: $Exports<'node-sass/test/fixtures/extras/my_custom_importer_file_and_data'>;
}
declare module 'node-sass/test/fixtures/extras/my_custom_importer_file_cb.js' {
declare module.exports: $Exports<'node-sass/test/fixtures/extras/my_custom_importer_file_cb'>;
}
declare module 'node-sass/test/fixtures/extras/my_custom_importer_file.js' {
declare module.exports: $Exports<'node-sass/test/fixtures/extras/my_custom_importer_file'>;
}
declare module 'node-sass/test/lowlevel.js' {
declare module.exports: $Exports<'node-sass/test/lowlevel'>;
}
declare module 'node-sass/test/runtime.js' {
declare module.exports: $Exports<'node-sass/test/runtime'>;
}
declare module 'node-sass/test/scripts/util/proxy.js' {
declare module.exports: $Exports<'node-sass/test/scripts/util/proxy'>;
}
declare module 'node-sass/test/spec.js' {
declare module.exports: $Exports<'node-sass/test/spec'>;
}
declare module 'node-sass/test/types.js' {
declare module.exports: $Exports<'node-sass/test/types'>;
}
declare module 'node-sass/test/useragent.js' {
declare module.exports: $Exports<'node-sass/test/useragent'>;
}
declare module 'node-sass/test/watcher.js' {
declare module.exports: $Exports<'node-sass/test/watcher'>;
}

View file

@ -35,8 +35,7 @@
"dist": "electron-builder",
"build": "cross-env NODE_ENV=production yarn compile:electron && electron-builder build",
"build:dir": "yarn build -- --dir -c.compression=store -c.mac.identity=null",
"lint": "eslint 'src/**/*.{js,jsx}' --fix && flow",
"format": "prettier 'src/**/*.{js,jsx,scss,json}' --write",
"lint": "eslint ui/**/*.{js,jsx} && eslint web/{component,effects,middleware,page,setup,src} && eslint electron/**/*.js && flow",
"flow-defs": "flow-typed install",
"precommit": "lint-staged",
"preinstall": "yarn cache clean lbry-redux && yarn cache clean lbryinc",
@ -150,7 +149,6 @@
"node-fetch": "^2.6.1",
"node-libs-browser": "^2.1.0",
"node-loader": "^0.6.0",
"node-sass": "^4.11.0",
"nodemon": "^1.19.1",
"postcss-import": "^12.0.1",
"postcss-loader": "^3.0.0",
@ -185,6 +183,7 @@
"remark-emoji": "^2.0.1",
"remark-react": "^4.0.3",
"reselect": "^3.0.0",
"sass": "^1.29.0",
"sass-loader": "^7.1.0",
"semver": "^5.3.0",
"stream-to-blob-url": "^2.1.1",

View file

@ -44,8 +44,6 @@ const MOUSE_BACK_BTN = 3;
const MOUSE_FORWARD_BTN = 4;
type Props = {
alertError: (string | {}) => void,
pageTitle: ?string,
language: string,
languages: Array<string>,
theme: string,

View file

@ -59,7 +59,7 @@ function AutoplayCountdown(props: Props) {
doPlayUri(nextRecommendedUri);
}
}
}, [navigateUrl, nextRecommendedUri, isFloating, doSetPlayingUri, doPlayUri]);
}, [navigateUrl, nextRecommendedUri, isFloating, doSetPlayingUri, doPlayUri, push]);
React.useEffect(() => {
const handleScroll = debounce(e => {

View file

@ -152,10 +152,12 @@ function ClaimListDiscover(props: Props) {
const feeAmountParam = urlParams.get('fee_amount') || feeAmount;
const originalPageSize = pageSize || CS.PAGE_SIZE;
const dynamicPageSize = isLargeScreen ? Math.ceil(originalPageSize * (3 / 2)) : originalPageSize;
const historyAction = history.action;
let orderParam = orderBy || urlParams.get(CS.ORDER_BY_KEY) || defaultOrderBy;
if (!orderParam) {
if (history.action === 'POP') {
if (historyAction === 'POP') {
// Reaching here means user have popped back to the page's entry point (e.g. '/$/tags' without any '?order=').
orderParam = orderParamEntry;
} else {
@ -166,14 +168,15 @@ function ClaimListDiscover(props: Props) {
React.useEffect(() => {
setOrderParamUser(orderParam);
}, [orderParam]);
}, [orderParam, setOrderParamUser]);
React.useEffect(() => {
// One-time update to stash the finalized 'orderParam' at entry.
if (history.action !== 'POP') {
if (historyAction !== 'POP') {
setOrderParamEntry(orderParam);
}
}, []);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [historyAction, setOrderParamEntry]);
let options: {
page_size: number,

View file

@ -117,13 +117,14 @@ function ClaimListHeader(props: Props) {
React.useEffect(() => {
setOrderParamUser(orderParam);
}, [orderParam]);
}, [orderParam, setOrderParamUser]);
React.useEffect(() => {
// One-time update to stash the finalized 'orderParam' at entry.
if (action !== 'POP') {
setOrderParamEntry(orderParam);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
function handleChange(change) {

View file

@ -1,5 +1,5 @@
// @flow
import React, { Suspense } from 'react';
import React from 'react';
import classnames from 'classnames';
import ReactQrCode from 'qrcode.react';

View file

@ -1,5 +0,0 @@
/* eslint react/display-name: 0 */
import React from 'react';
export default ({ rule = '' }) => <css-doodle use="var(--rule)">{rule}</css-doodle>;

View file

@ -58,7 +58,7 @@ function FileDownloadLink(props: Props) {
setDidClickDownloadButton(false);
}
}, [streamingUrl, didClickDownloadButton]);
}, [streamingUrl, didClickDownloadButton, fileName]);
// @endif
function handleDownload(e) {

View file

@ -104,15 +104,17 @@ export default function FileRenderFloating(props: Props) {
}
// Updated 'relativePos' based on persisted 'position':
const stringifiedPosition = JSON.stringify(position);
useEffect(() => {
const jsonPosition = JSON.parse(stringifiedPosition);
setRelativePos({
x: position.x / getScreenWidth(),
y: position.y / getScreenHeight(),
x: jsonPosition.x / getScreenWidth(),
y: jsonPosition.y / getScreenHeight(),
});
}, []);
}, [stringifiedPosition]);
// Ensure player is within screen when 'isFloating' changes.
const stringifiedPosition = JSON.stringify(position);
useEffect(() => {
const jsonPosition = JSON.parse(stringifiedPosition);

View file

@ -36,14 +36,17 @@ function InviteNew(props: Props) {
// Referral link
const [referralSource, setReferralSource] = useState(referralCode);
function handleReferralChange(code) {
setReferralSource(code);
// TODO: keep track of this in an array?
const matchingChannel = channels && channels.find(ch => ch.name === code);
if (matchingChannel) {
analytics.apiLogPublish(matchingChannel);
}
}
const handleReferralChange = React.useCallback(
code => {
setReferralSource(code);
// TODO: keep track of this in an array?
const matchingChannel = channels && channels.find(ch => ch.name === code);
if (matchingChannel) {
analytics.apiLogPublish(matchingChannel);
}
},
[setReferralSource]
);
const topChannel =
channels &&
@ -64,7 +67,7 @@ function InviteNew(props: Props) {
if (topChannel) {
handleReferralChange(topChannel.name);
}
}, [topChannel]);
}, [topChannel, handleReferralChange]);
function lookupUrlByClaimName(name, channels) {
const claim = channels.find(channel => channel.name === name);

View file

@ -63,19 +63,19 @@ function Invited(props: Props) {
uri: fullUri,
});
}
}, [fullUri, isSubscribed]);
}, [fullUri, isSubscribed, channelSubscribe]);
useEffect(() => {
if (!referrerSetPending && hasVerifiedEmail) {
claimReward();
}
}, [referrerSetPending, hasVerifiedEmail]);
}, [referrerSetPending, hasVerifiedEmail, claimReward]);
useEffect(() => {
if (referrer) {
setReferrer(referrer.replace(':', '#'));
}
}, [referrer]);
}, [referrer, setReferrer]);
function handleDone() {
history.push(redirect);

View file

@ -68,7 +68,7 @@ function Page(props: Props) {
if (isOnFilePage || isMediumScreen) {
setSidebarOpen(false);
}
}, [isOnFilePage, isMediumScreen]);
}, [isOnFilePage, isMediumScreen, setSidebarOpen]);
return (
<Fragment>

View file

@ -43,7 +43,7 @@ function PostEditor(props: Props) {
if (editing && uri) {
fetchStreamingUrl(uri);
}
}, [uri, editing]);
}, [uri, editing, fetchStreamingUrl]);
// Ready to edit content
useEffect(() => {
@ -75,7 +75,7 @@ function PostEditor(props: Props) {
updatePublishForm({ fileText: text });
}
} catch (error) {
console.error(error);
console.error(error); // eslint-disable-line
}
}

View file

@ -26,18 +26,22 @@ export default function RecommendedContent(props: Props) {
const isMobile = useIsMobile();
const isMedium = useIsMediumScreen();
function getRecommendedContent() {
if (claim && claim.value && claim.claim_id) {
const options: Options = { size: 20, related_to: claim.claim_id, isBackgroundSearch: true };
if (claim && !mature) {
options['nsfw'] = false;
}
const { title } = claim.value;
if (title && options) {
search(title, options);
const stringifiedClaim = JSON.stringify(claim);
const getRecommendedContent = React.useCallback(() => {
if (stringifiedClaim) {
const jsonClaim = JSON.parse(stringifiedClaim);
if (jsonClaim && jsonClaim.value && jsonClaim.claim_id) {
const options: Options = { size: 20, related_to: jsonClaim.claim_id, isBackgroundSearch: true };
if (jsonClaim && !mature) {
options['nsfw'] = false;
}
const { title } = jsonClaim.value;
if (title && options) {
search(title, options);
}
}
}
}
}, [stringifiedClaim, mature]);
React.useEffect(() => {
getRecommendedContent();

View file

@ -1,6 +1,11 @@
// @flow
import React from 'react';
const Theme = props => {
type Props = {
themePath: ?string,
};
const Theme = (props: Props) => {
const { themePath } = props;
if (!themePath) {

View file

@ -32,7 +32,6 @@ export default function useStream(url) {
if (isMounted.current) {
const buffer = Buffer.concat(chunks);
const blob = new Blob([buffer]);
console.info(response);
setState({ content: blob, loading: false });
}
});

View file

@ -45,12 +45,15 @@ function saveMessage(message) {
but this seems better than silently having this limitation and future devs not knowing.
*/
// @if TARGET='web'
// $FlowFixMe
// eslint-disable
function saveMessage(message) {
if (!isProduction && knownMessages === null) {
console.log('Note that i18n messages are not saved in web dev mode.');
knownMessages = {};
}
}
// eslint-enable
// @endif
function removeContextMetadata(message) {

View file

@ -5,7 +5,7 @@ const protocol = 'lbry://';
const uriRegex = /(lbry:\/\/)[^\s"]*[^)]/g;
const mentionToken = '@';
const mentionTokenCode = 64; // @
// const mentionTokenCode = 64; // @
const mentionRegex = /@[^\s()"]*/gm;
const invalidRegex = /[-_.+=?!@#$%^&*:;,{}<>\w/\\]/;

View file

@ -1,15 +0,0 @@
// @if TARGET='app'
import { remote } from 'electron';
const win = remote.getCurrentWindow();
const setProgressBar = progress => {
win.setProgressBar(progress);
};
// @endif
// @if TARGET='web'
const setProgressBar = progress => {};
// @endif
export default setProgressBar;

View file

@ -12,7 +12,7 @@ function queryPool(sql, params) {
return new Promise(resolve => {
pool.query(sql, params, (error, rows) => {
if (error) {
console.log('error', error);
console.log('error', error); // eslint-disable-line
resolve();
return;
}

738
yarn.lock

File diff suppressed because it is too large Load diff