Fix warnings and errors

This commit is contained in:
Ben van Hartingsveldt 2025-09-16 13:42:47 +02:00
parent e502b1502d
commit e22bf38827
No known key found for this signature in database
GPG key ID: 261AA214130CE7AB
73 changed files with 3781 additions and 3812 deletions

View file

@ -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,

View file

@ -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');

View file

@ -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) {

View file

@ -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);

View file

@ -23,7 +23,6 @@ declare module 'async-exit-hook' {
* needed.
*/
// Filename aliases
declare module 'async-exit-hook/index' {
declare module.exports: $Exports<'async-exit-hook'>;

View file

@ -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>;

View file

@ -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<{

View file

@ -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">;
}

View file

@ -23,7 +23,6 @@ declare module 'decompress' {
* needed.
*/
// Filename aliases
declare module 'decompress/index' {
declare module.exports: $Exports<'decompress'>;

View file

@ -37,7 +37,7 @@ type $npm$del$Options = {
absolute?: boolean
};
declare module "del" {
declare module 'del' {
declare class Del {
(
patterns: $npm$del$Patterns,

View file

@ -23,7 +23,6 @@ declare module 'electron-dl' {
* needed.
*/
// Filename aliases
declare module 'electron-dl/index' {
declare module.exports: $Exports<'electron-dl'>;

View file

@ -23,7 +23,6 @@ declare module 'electron-is-dev' {
* needed.
*/
// Filename aliases
declare module 'electron-is-dev/index' {
declare module.exports: $Exports<'electron-is-dev'>;

View file

@ -23,7 +23,6 @@ declare module 'electron-window-state' {
* needed.
*/
// Filename aliases
declare module 'electron-window-state/index' {
declare module.exports: $Exports<'electron-window-state'>;

View file

@ -23,7 +23,6 @@ declare module 'eslint-config-standard-jsx' {
* needed.
*/
// Filename aliases
declare module 'eslint-config-standard-jsx/index' {
declare module.exports: $Exports<'eslint-config-standard-jsx'>;

View file

@ -23,7 +23,6 @@ declare module 'eslint-config-standard' {
* needed.
*/
// Filename aliases
declare module 'eslint-config-standard/index' {
declare module.exports: $Exports<'eslint-config-standard'>;

View file

@ -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;

View file

@ -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;
}

View file

@ -23,7 +23,6 @@ declare module 'json-loader' {
* needed.
*/
// Filename aliases
declare module 'json-loader/index' {
declare module.exports: $Exports<'json-loader'>;

View file

@ -23,7 +23,6 @@ declare module 'lbry-format' {
* needed.
*/
// Filename aliases
declare module 'lbry-format/index' {
declare module.exports: $Exports<'lbry-format'>;

View file

@ -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;

View file

@ -69,8 +69,7 @@ declare class moment$LocaleData {
isPM(date: string): boolean;
meridiem(hours: number, minutes: number, isLower: boolean): string;
calendar(
key:
| "sameDay"
key: | "sameDay"
| "nextDay"
| "lastDay"
| "nextWeek"
@ -123,8 +122,7 @@ declare class moment$Moment {
static ISO_8601: string;
static (string?: ?string): moment$Moment;
static (
initDate:
| moment$MomentOptions
initDate: | moment$MomentOptions
| number
| Date
| Array<number>
@ -157,8 +155,7 @@ 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>
@ -373,6 +370,6 @@ declare class moment$Moment {
static invalid(object: any): moment$Moment;
}
declare module "moment" {
declare module 'moment' {
declare module.exports: Class<moment$Moment>;
}

View file

@ -23,7 +23,6 @@ declare module 'node-loader' {
* needed.
*/
// Filename aliases
declare module 'node-loader/index' {
declare module.exports: $Exports<'node-loader'>;

View file

@ -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;

View file

@ -23,7 +23,6 @@ declare module 'raw-loader' {
* needed.
*/
// Filename aliases
declare module 'raw-loader/index' {
declare module.exports: $Exports<'raw-loader'>;

View file

@ -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>>(

View file

@ -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()
// ------------------------------------------------------------

View file

@ -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

View file

@ -23,7 +23,6 @@ declare module 'remark-react' {
* needed.
*/
// Filename aliases
declare module 'remark-react/index' {
declare module.exports: $Exports<'remark-react'>;

View file

@ -23,7 +23,6 @@ declare module 'remark' {
* needed.
*/
// Filename aliases
declare module 'remark/index' {
declare module.exports: $Exports<'remark'>;

View file

@ -23,7 +23,6 @@ declare module 'render-media' {
* needed.
*/
// Filename aliases
declare module 'render-media/index' {
declare module.exports: $Exports<'render-media'>;

View file

@ -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

View file

@ -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"

View file

@ -23,7 +23,6 @@ declare module 'stream-to-blob-url' {
* needed.
*/
// Filename aliases
declare module 'stream-to-blob-url/index' {
declare module.exports: $Exports<'stream-to-blob-url'>;

View file

@ -64,8 +64,7 @@ declare module 'webpack' {
declare type ExternalItem =
| string
| {
[k: string]:
| string
[k: string]: | string
| {
[k: string]: any,
}
@ -81,14 +80,12 @@ 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
@ -146,8 +143,7 @@ declare module 'webpack' {
rules?: RuleSetRules,
sideEffects?: boolean,
test?: RuleSetConditionOrConditions,
type?:
| 'javascript/auto'
type?: | 'javascript/auto'
| 'javascript/dynamic'
| 'javascript/esm'
| 'json'
@ -197,8 +193,7 @@ declare module 'webpack' {
declare type OptimizationSplitChunksOptions = {
automaticNameDelimiter?: string,
cacheGroups?: {
[k: string]:
| false
[k: string]: | false
| Function
| string
| RegExp
@ -255,8 +250,7 @@ declare module 'webpack' {
providedExports?: boolean,
removeAvailableModules?: boolean,
removeEmptyChunks?: boolean,
runtimeChunk?:
| boolean
runtimeChunk?: | boolean
| ('single' | 'multiple')
| {
name?: string | Function,
@ -273,8 +267,7 @@ declare module 'webpack' {
};
declare type OutputOptions = {
auxiliaryComment?:
| string
auxiliaryComment?: | string
| {
amd?: string,
commonjs?: string,
@ -302,8 +295,7 @@ declare module 'webpack' {
jsonpScriptType?: false | 'text/javascript' | 'module',
library?: string | Array<string> | LibraryCustomUmdObject,
libraryExport?: string | ArrayOfStringValues,
libraryTarget?:
| 'var'
libraryTarget?: | 'var'
| 'assign'
| 'this'
| 'window'
@ -337,8 +329,7 @@ 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,
@ -384,8 +375,7 @@ declare module 'webpack' {
chunkOrigins?: boolean,
chunks?: boolean,
chunksSort?: string,
colors?:
| boolean
colors?: | boolean
| {
bold?: string,
cyan?: string,
@ -448,8 +438,7 @@ declare module 'webpack' {
disableHostCheck?: boolean,
filename?: string,
headers?: { [key: string]: string },
historyApiFallback?:
| boolean
historyApiFallback?: | boolean
| {
rewrites?: Array<{ from: string, to: string }>,
disableDotRule?: boolean,
@ -457,8 +446,7 @@ declare module 'webpack' {
host?: string,
hot?: boolean,
hotOnly?: boolean,
https?:
| boolean
https?: | boolean
| {
key: string,
cert: string,
@ -470,8 +458,7 @@ declare module 'webpack' {
noInfo?: boolean,
open?: boolean | string,
openPage?: string,
overlay?:
| boolean
overlay?: | boolean
| {
errors?: boolean,
warnings?: boolean,
@ -506,8 +493,7 @@ 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'
@ -568,8 +554,7 @@ declare module 'webpack' {
resolveLoader?: ResolveOptions,
serve?: { [k: string]: any },
stats?: StatsOptions,
target?:
| 'web'
target?: | 'web'
| 'webworker'
| 'node'
| 'async-node'

View file

@ -23,7 +23,6 @@ declare module 'y18n' {
* needed.
*/
// Filename aliases
declare module 'y18n/index' {
declare module.exports: $Exports<'y18n'>;

View file

@ -23,7 +23,6 @@ declare module 'yarnhook' {
* needed.
*/
// Filename aliases
declare module 'yarnhook/index' {
declare module.exports: $Exports<'yarnhook'>;

View file

@ -5,5 +5,3 @@ declare type ReportContentState = {
isReporting: boolean,
error: string,
};

View file

@ -95,8 +95,8 @@ const YOUTUBER_CHANNEL_IDS = [
channelLimit: 1,
daysOfContent: 30,
pageSize: 24,
//pinnedUrls: [],
//mixIn: [],
// pinnedUrls: [],
// mixIn: [],
};
module.exports = { YOUTUBERS };

View file

@ -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

View file

@ -236,7 +236,15 @@ function App(props: Props) {
fetchModBlockedList();
fetchModAmIList();
}
}, [hasMyChannels, hasNoChannels, hasActiveChannelClaim, setActiveChannelIfNotSet, setIncognito]);
}, [
fetchModAmIList,
fetchModBlockedList,
hasMyChannels,
hasNoChannels,
hasActiveChannelClaim,
setActiveChannelIfNotSet,
setIncognito,
]);
useEffect(() => {
// $FlowFixMe

View file

@ -102,7 +102,7 @@ function ChannelContent(props: Props) {
}
}, DEBOUNCE_WAIT_DURATION_MS);
return () => clearTimeout(timer);
}, [claimId, searchQuery, showMature]);
}, [claimId, doResolveUris, searchQuery, showMature]);
React.useEffect(() => {
setSearchQuery('');

View file

@ -121,7 +121,7 @@ function ChannelForm(props: Props) {
bidError ||
(isNewChannel && !params.name)
);
}, [isClaimingInitialRewards, creatingChannel, updatingChannel, nameError, bidError, isNewChannel, params.name]);
}, [coverError, isClaimingInitialRewards, creatingChannel, updatingChannel, bidError, isNewChannel, params.name]);
function getChannelParams() {
// fill this in with sdk data

View file

@ -385,7 +385,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
</NavLink>
)}
</div>
<div className="claim-tile__info" uri={uri}>
<div className="claim-tile__info">
{!isChannelUri && signingChannel && (
<div className="claim-preview__channel-staked">
<UriIndicator focusable={false} uri={uri} link hideAnonymous>

View file

@ -260,7 +260,7 @@ function CollectionForm(props: Props) {
const collectionClaimIds = JSON.parse(collectionClaimIdsString);
setParams({ ...params, claims: collectionClaimIds });
clearCollectionErrors();
}, [collectionClaimIdsString, setParams]);
}, [clearCollectionErrors, params, collectionClaimIdsString, setParams]);
React.useEffect(() => {
let nameError;
@ -302,14 +302,14 @@ function CollectionForm(props: Props) {
setParam({ channel_id: undefined });
}
}
}, [activeChannelId, incognito, initialized]);
}, [setParam, 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]);
}, [uri, hasClaim, getCollectionParams, updateParams]);
React.useEffect(() => {
resetThumbnailStatus();

View file

@ -58,7 +58,7 @@ function FileList(props: Props) {
}
}
}
}, [radio, onChange]);
}, [radio, onChange, getFile]);
return (
<div className={'file-list'}>

View file

@ -23,7 +23,7 @@ function LoginGraphic(props: any) {
} else {
setSrc(imgUrl);
}
}, []);
}, [imgUrl]);
if (error || !imgUrl) {
return null;

View file

@ -120,7 +120,7 @@ function PublishFile(props: Props) {
processSelectedFile(fileData);
}
readSelectedFileDetails();
}, [filePath]);
}, [filePath, processSelectedFile]);
useEffect(() => {
const isOptimizeAvail = currentFile && currentFile !== '' && isVid && ffmpegAvail;

View file

@ -262,7 +262,7 @@ function PublishForm(props: Props) {
if (publishing || publishSuccess) {
clearPublish();
}
}, [clearPublish]);
}, [clearPublish, publishing, publishSuccess]);
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]);
}, [mode, _uploadType, replace]);
// @if TARGET='app'
// Save file changes locally ( desktop )

View file

@ -87,7 +87,7 @@ export default function ReportContent(props: Props) {
claim_ids: [claimId],
});
}
}, [claim, claimId]);
}, [claim, claimId, doClaimSearch]);
// 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;

View file

@ -196,7 +196,7 @@ function RepostCreate(props: Props) {
if (repostTakeoverAmount) {
setAutoRepostBid(repostTakeoverAmount);
}
}, [enteredRepostAmount, passedRepostAmount]);
}, [setAutoRepostBid, enteredRepostAmount, passedRepostAmount]);
// repost bid error
React.useEffect(() => {
@ -211,7 +211,7 @@ function RepostCreate(props: Props) {
rBidError = __('Your deposit must be higher');
}
setRepostBidError(rBidError);
}, [setRepostBidError, repostBidError, repostBid]);
}, [balance, setRepostBidError, repostBidError, repostBid]);
// setContentUri given enteredUri
React.useEffect(() => {

View file

@ -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);

View file

@ -34,7 +34,7 @@ export default function SettingStorage(props: Props) {
cleanBlobs().then(() => {
setCleaning(false);
});
}, []);
}, [cleanBlobs]);
return (
<>

View file

@ -105,7 +105,7 @@ function SettingViewHosting(props: Props) {
if (unlimited && viewHostingLimit !== 0) {
handleApply();
}
}, [unlimited, viewHostingLimit]);
}, [handleApply, unlimited, viewHostingLimit]);
return (
<>

View file

@ -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();
}
}, [walletRollbackToDefault]);
}, [doClear, walletRollbackToDefault]);
useEffect(() => {
if (usingCustomServer) {

View file

@ -89,7 +89,14 @@ const SupportsLiquidate = (props: Props) => {
}
setUnlockTextAmount(String(defaultValue));
setDefaultValueAssigned(true);
}, [defaultValueAssigned, previewBalance, unlockTextAmount, setUnlockTextAmount, setDefaultValueAssigned]);
}, [
defaultValue,
defaultValueAssigned,
previewBalance,
unlockTextAmount,
setUnlockTextAmount,
setDefaultValueAssigned,
]);
// Update message & error based on unlock amount.
useEffect(() => {
@ -117,7 +124,7 @@ const SupportsLiquidate = (props: Props) => {
setMessage(initialMessage);
setError(false);
}
}, [unlockTextAmount, previewBalance, setMessage, setError]);
}, [initialMessage, unlockTextAmount, previewBalance, setMessage, setError]);
return (
<Card

View file

@ -34,16 +34,8 @@ 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();
@ -118,7 +110,7 @@ function SyncEnableFlow(props: Props) {
setStep(FETCH_FOR_DISABLE);
}
}
}, [mode, setPassword]);
}, [mode, setPassword, checkSync]);
React.useEffect(() => {
if (step === FETCH_FOR_ENABLE) {
@ -146,7 +138,7 @@ function SyncEnableFlow(props: Props) {
setStep(CONFIRM);
});
}
}, [step, setPrefDict, setStep, password]);
}, [step, setPrefDict, setStep, password, getSync]);
if (getSyncPending) {
return (

View file

@ -15,7 +15,7 @@ export default function TextareaSuggestionsItem(props: Props) {
const { name: value, url, unicode } = emote;
return (
<div {...autocompleteProps} dispatch={undefined}>
<div {...autocompleteProps}>
{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} dispatch={undefined}>
<div {...autocompleteProps}>
<ChannelThumbnail xsmall uri={uri} />
<div className="textareaSuggestion__label">

View file

@ -56,7 +56,7 @@ function UserChannelFollowIntro(props: Props) {
};
setTimeout(delayedChannelSubscribe, 1000);
}
}, [prefsReady]);
}, [prefsReady, channelSubscribe]);
return (
<Card

View file

@ -87,7 +87,7 @@ function UserEmailNew(props: Props) {
if (emailExists) {
handleChangeToSignIn();
}
}, [emailExists]);
}, [emailExists, handleChangeToSignIn]);
return (
<div className={classnames('main__sign-up')}>

View file

@ -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]);
}, [showEmail, showPassword, showLoading, hasVerifiedEmail, history, redirect]);
React.useEffect(() => {
if (emailToVerify && emailOnlyLogin) {

View file

@ -110,7 +110,7 @@ function UserSignUp(props: Props) {
if (previousHasVerifiedEmail === false && hasVerifiedEmail && prefsReady) {
setSettingAndSync(SETTINGS.FIRST_RUN_STARTED, true);
}
}, [hasVerifiedEmail, previousHasVerifiedEmail, prefsReady]);
}, [hasVerifiedEmail, previousHasVerifiedEmail, prefsReady, setSettingAndSync]);
React.useEffect(() => {
// Don't claim the reward if sync is enabled until after a sync has been completed successfully

View file

@ -157,7 +157,7 @@ const VideoJsEvents = ({
.getChild('TheaterModeButton')
.controlText(videoTheaterMode ? __('Default Mode (t)') : __('Theater Mode (t)'));
}
}, [videoTheaterMode]);
}, [videoTheaterMode, playerRef]);
// 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]);
}, [autoplaySetting, playerRef]);
useEffect(() => {
const player = playerRef.current;
if (replay && player) {
player.play();
}
}, [replay]);
}, [replay, playerRef]);
function initializeEvents() {
const player = playerRef.current;

View file

@ -245,7 +245,7 @@ export default React.memo<Props>(function VideoJs(props: Props) {
window.player = undefined;
}
};
}, [isAudio, source]);
}, [isAudio, source, curried_function, createVideoPlayerDOM, detectFileType, initializeVideoPlayer]);
// Update video player and reload when source URL changes
useEffect(() => {
@ -279,7 +279,7 @@ export default React.memo<Props>(function VideoJs(props: Props) {
player.bigPlayButton.hide();
}
});
}, [source, reload]);
}, [source, reload, sourceType, videoJsOptions.sources]);
return (
// $FlowFixMe

View file

@ -24,5 +24,5 @@ export default function useHistoryNav(history) {
window.addEventListener('keydown', handleKeyPress);
}
return () => window.removeEventListener('keydown', handleKeyPress);
}, [el]);
}, [el, history]);
}

View file

@ -71,7 +71,7 @@ export default function useLazyLoading(
// $FlowFixMe
lazyLoadingObserver.observe(elementRef.current);
}, deps);
}, [backgroundFallback, elementRef, yOffsetPx]);
return srcLoaded;
}

View file

@ -71,7 +71,7 @@ function ModalAffirmPurchase(props: Props) {
clearTimeout(timeout);
}
};
}, [success, uri]);
}, [success, uri, closeModal]);
return (
<Modal type="card" isOpen contentLabel={modalTitle} onAborted={cancelPurchase}>

View file

@ -92,11 +92,11 @@ function FileListPublished(props: Props) {
params.set('searchText', searchText);
history.replace('?' + params.toString());
debounceFilter();
}, [myClaims, searchText]);
}, [myClaims, searchText, debounceFilter, history, search]);
useEffect(() => {
doFilterClaims();
}, [myClaims, filterBy]);
}, [myClaims, filterBy, doFilterClaims]);
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]);
}, [filteredClaims, history, search]);
useEffect(() => {
fetchAllMyClaims();

View file

@ -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]);
}, [name, notifications, stringifiedNotificationCategories, doNotificationList]);
const notificationListElement = (
<>

View file

@ -53,7 +53,7 @@ export default function NotificationSettingsPage(props: Props) {
setError(true);
});
}
}, [isAuthenticated]);
}, [lbryIoParams, isAuthenticated]);
function handleChangeTag(name, newIsEnabled) {
const tagParams = newIsEnabled ? { add: name } : { remove: name };

View file

@ -39,13 +39,13 @@ function SignInVerifyPage(props: Props) {
if (!authToken || !userSubmittedEmail || !verificationToken) {
onAuthError(__('Invalid or expired sign-in link.'));
}
}, [authToken, userSubmittedEmail, verificationToken, doToast, push]);
}, [onAuthError, authToken, userSubmittedEmail, verificationToken, doToast, push]);
React.useEffect(() => {
if (!needsRecaptcha) {
verifyUser();
}
}, [needsRecaptcha]);
}, [verifyUser, needsRecaptcha]);
React.useEffect(() => {
let captchaTimeout;

View file

@ -46,7 +46,7 @@ let baseConfig = {
loader: 'postcss-loader',
options: {
postcssOptions: {
plugins: function () {
plugins: function() {
return [require('postcss-rtl')()];
},
},
@ -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, '\\\\')}"`,