Commit graph

11 commits

Author SHA1 Message Date
infinite-persistence
b733215c5f
PublishFile: fix render function violation (#1518)
* PublishFile: fix render function violation

Per doc:
> A React component should not cause side effects in other components during rendering.

Even in own render function (allowed to call), it should be avoided as it could cause infinite loops.

* PublishFile: fix useEffect infinite loop due to bad dependency

## Issue
One of the effects was adding an internal wrapper function as a dependency. As this is a functional component, the wrapper is re-created on every render and would spark the effect. That effect also updates redux (depending on the code path), so we end up in a loop.

## Change 1
Two options to fix the dependency:
1. Just remove the wrappers from the list, since we "know" it is essentially the same function (i.e. it's not function-variable that could point to something else at runtime).
2. Peek into the wrapper and determine what are the actual dependencies (usually props or data derived from props).

Solution 2 is the norm.

Aside: wrappers are usually the root-cause of incorrect dependencies, because they mask away the actual code. Need to always peek into it.

## Change 2
Next, change the dispatch-to-props map from function version to object version so that we have stable references to the actions. The object version is also preferred when we don't need to make any customizations to the actions.
2022-05-19 10:41:32 -04:00
infinite-persistence
8deac56e40
Fix memo: isLivestream & isLivestreamActive 2021-11-16 11:52:35 +08:00
Merge
30023422b8
Desktop cherry-pick: "7240 Integrate lbry redux and lbryinc" 2021-10-19 20:40:07 +08:00
jessopb
989126c603
Feat publish replays on master (#5863)
* provide livestream replay publish via url
2021-04-14 00:06:11 -04:00
btzr-io
a5d1746151 add in-app text and markdown publishing 2020-08-04 11:49:12 -04:00
Sean Yesmunt
7138fe54bc bring in 'notifications' state from lbry-redux 2020-06-16 09:56:32 -04:00
jessop
50f7761bc2 save optimize check to fix publish navigation file reloading 2020-03-31 13:00:13 -04:00
Thomas Zarebczan
e35fbdd86a make transcoding work
appstrings

provide optimize checkbox on publish

fix missing status

no crash on web

cleanup

better settings ui

add help and time estimate to publish transcoding

messaging

fix: Special SDK + fix config name

fix: older SDK build

fix app string, style tweak

whoops, and looks better to me this way.

bump SDK
2020-03-25 13:42:40 -04:00
Sean Yesmunt
ea6855df08 quick fix to add a cancel button on publish 2019-12-26 10:40:08 -05:00
Sean Yesmunt
ef27683726 fix file upload limit error 2019-12-10 10:08:14 -05:00
Sean Yesmunt
6ad31a3ce9 refactor lbrytv web server 2019-11-11 13:27:29 -05:00
Renamed from src/ui/component/publishFile/index.js (Browse further)