Commit graph

4465 commits

Author SHA1 Message Date
infinite-persistence
827a08ac26
Fix memo: stake indicator 2021-11-11 10:23:28 +08:00
infinite-persistence
6492fe1c66
Upload: remove "download app" suggestion for large files. 2021-11-11 10:16:31 +08:00
Thomas Zarebczan
d649e3563f
Adjust channel mention regex (#269) 2021-11-10 14:53:42 -05:00
Thomas Zarebczan
5c23c6d88e
Default to trending for homepages (#267) 2021-11-10 14:36:54 -05:00
Dan Peterson
5639e4c1ff
Adjust some initial states to optimize initial render (#265) 2021-11-10 14:15:40 -05:00
infinite-persistence
cb6a044584
Support resume-able upload via tus (#186)
* Publish button: use spinner instead of "Publishing..."

Looks better, plus the preview could take a while sometimes.

* Refactor `doPublish`. No functional change

This is to allow `doPublish` to accept a custom payload as an input (for resuming uploads), instead of always resolving it from the redux data.

* Add doPublishResume

* Support resume-able upload via tus

## Issue
38 Handle resumable file upload

## Notes
Since we can't serialize a File object, we'll need to the user to re-select the file to resume.

* Exclude "modified date" for Firefox/Android

## Issue
It appears that the modification date of the Android file changes when selected, so that file was deemed "different" when trying to resume upload.

## Change
Exclude modification date for now. Let's assume a smart user.

* Move 'currentUploads' to 'publish' reducer

`publish` is currently rehydrated, so we can ride on that and don't need to store the `currentUploads` in `localStorage` for persistence. This would allow us to store Markdown Post data too, as `localStorage` has a 5MB limit per app.

We could have also made `webReducer` rehydrate, but in this repo, there is no need to split it to another reducer. It also makes more sense to be part of publish anyway (at least to me).

This change is mostly moving items between files, with the exception of
1. An additional REHYDRATE in the publish reducer to clean up the tusUploader.
2. Not clearing `currentUploads` in CLEAR_PUBLISH.

* Restore v1 code for livestream replay, etc.

v2 (tus) does not handle `remote_url`, so the app still needs v1 for that. Since we'll still have v1 code, use v1 for previews as well.
2021-11-10 13:16:16 -05:00
infinite-persistence
d211450b5b
Fix selectCommentIdsForUri
- memo not required.
- start to not use the confusing and wrongly-named 'selectCommentsByUri' (per comment from Sean);  use the existing 'selectClaimIdForUri' instead.  This works because currently we do fetch any comments without first visiting a claim/uri, so we'll always have fetched the required claim, and can be queried in 'selectClaimIdForUri'.
2021-11-10 17:35:30 +08:00
infinite-persistence
81d77da17e
Fix states not updated in an immutable way.
It's technically incorrect and was causing the GUI to not update sometimes because the reference did not change, despite the array contents did. The GUI just happens to update most of the time due to other state changes.
2021-11-10 17:35:29 +08:00
infinite-persistence
7cefb0fadc
Simplify 'selectClaimIdForUri'
Memoization is not needed. But note that it is now a 2 parameter selector.
2021-11-10 16:50:26 +08:00
infinite-persistence
ece2312ec5 selectClaimIsMineForUri to replace makeSelectClaimIsMine
## Issue
`normalizeUri` | `parseURI` is expensive and has been causing sluggish operations when called repeatedly or within a loop.

## Change
Since I'm not confident enough to remove the call entirely from makeSelectClaimIsMine (although I've yet to find a scenario that the uri is not already normalized), we'll try caching the calls instead.

## Results
- in a simple test of toggling between 2 category pages, we saved 20ms from `parseURI` calls alone.

- in a test of opening all categories one time, the memory usage remained similar. This makes sense since we removed a `makeSelect*` (which creates a selector for each call + not memoizing), and replaced that with a cached selector that's actually memoizing.
2021-11-10 16:49:12 +08:00
infinite-persistence
97b9b733c6
Fix memo: selectMyActiveClaims, selectAbandoningIds
## Issue
- selectMyActiveClaims memo problem -- being recalculated on every click -- high workload for wallet with large uploads.
- Mistake in handling abandoning IDs (it was trying to extract keys from an array)

## Changes
- selectAbandoningIds: never use `state` as an input selector. Breaks memo.
- Don't use selectMyClaimsRaw and then reduce it back to IDs. Use selectMyClaimIdsRaw instead.
- selectAbandoningIds is already in array form, so don't run Object.keys.
- Fix abandoningById never clearing when succeeded.
2021-11-10 09:58:26 +08:00
Dan Peterson
baa15d0c42
add long polling to reset component 2021-11-10 08:21:16 +08:00
Dan Peterson
1d8753e2ba
Revert claim preview + fix small css issue + export named function 2021-11-10 08:21:16 +08:00
Dan Peterson
60f06dac52
Fix livestream state issues. Create unified long polling mechanism. 2021-11-10 08:21:15 +08:00
saltrafael
a7c7881795
Fix string (#257) 2021-11-09 15:25:19 -05:00
infinite-persistence
ef1ebfc491
Allow admins to delete comments as well. (#250)
This is a follow-up to #235
2021-11-09 09:47:49 -05:00
infinite-persistence
bc67379c26
Block: pass comment ID for deletion when being blocked. (#255)
* Simplify dispatch map

Since none of dispatches are doing any custom transformation, just use a direct map. The number of arguments for the comment function are getting crazy.

* Block: pass comment ID for deletion when being blocked.
2021-11-09 09:43:02 -05:00
infinite-persistence
0e2bb350c0
Remove mouse-back/forward listeners
- Not needed for web since the browser does it, and should have been gated under 'app'
- This reverts lbry-desktop 3744.
2021-11-09 16:53:11 +08:00
infinite-persistence
9fc417edfa
Remove 'web' preprocessor 2021-11-09 16:08:13 +08:00
infinite-persistence
45ad08ec32
Remove use-history-nav.js
For electron.js only
2021-11-09 16:03:37 +08:00
infinite-persistence
b9a5dc3c70
Remove use-zoom
It's only needed for electron
2021-11-09 15:57:12 +08:00
infinite-persistence
1426dd5b83
Remove skin support and lbry.tv scss
## Issue
211 - CSS load-order problem

## Notes
It is unlikely that we'll need to support different brands in the future, so simplifying the code and number of files so that we don't have to handle the various import paths. Will probably make things easier for the css-splitting work too.
2021-11-09 10:36:08 +08:00
Thomas Zarebczan
d80cea1caa
new Stickers! (#248) 2021-11-08 18:07:55 -05:00
infinite-persistence
7a6a8c2fd7
Comment: Fix missing author highlight in Community Tag (#249)
## Issue
238 Comments: author-name not highlighted when in Channel Community tab

## Changes
- Channel claims don't have a signing channel. Use `getChannelFromClaim`, which handles both content and channel claim.
2021-11-08 18:05:54 -05:00
infinite-persistence
c97cab0ebb
byId[] fixes to reduce invalidation (#239)
* Don't update 'pendingById' if no changes.

'pendingById' isn't frequently updated, but using it as a proof-of-concept to fix how reducers should be written to avoid unnecessary updates.

ImmutableJS apparently does all of this for us, but there are cons to using it as well, so using own wrappers for now.

* Don't update 'byId' if no changes + add 'selectClaimWithId'

## Ticket
116 Claim store optimization ideas (reducing unnecessary renders)

## Changes
- Ignore things like `confirmations` so that already-fetched claims aren't invalidated and causes re-rendering. The `stringify` might look expensive, but the amount of avoided re-renders outweighs it. There might be faster ways to compare, though.

- With `byId[claimId]` references more stable now, memoized selectors can now use 'selectClaimWithId' to pick a specific claim to depend on, instead of 'byId' which changes on every update.

* Fix memo: selectMyChannelClaims, selectActiveChannelClaim

## Issue
These should never recalculate after `channel_list` has been fetched, but they do because of poor selector dependency.

## Change
With the `byId` changes from the previous commit, we are now able to memoize these selectors correctly.
2021-11-08 12:25:29 -05:00
infinite-persistence
cfd67b1c8d
Allow moderators to delete comment (#235)
## Ticket
223 Add ability for delegated moderators to delete comments

## Changes
- Refactored doCommentAbandon's signature so we don't end up converting between "uri" and "Claim" several times and needing to lookup redux when the client can already provide us the exact values that we need.

- Pass the new moderator fields to the API.

- Remove the need to call 'makeSelectChannelPermUrlForClaimUri' since it's a simple field query when we already have the claim.
2021-11-08 12:22:40 -05:00
saltrafael
9138e508c6
[Markdown] Fixes Quote and Fixes Images not showing (#242)
* Refactor and fix blockquote filling the full message content

* Fix images not showing on markdown
2021-11-08 09:08:22 -05:00
maxime peabody
d7ada7904b
Fixes the play/pause on drag issue with the floating player. (#221)
I tried to use event.preventDefault on the click handler but that didn't 
work. So instead I'm using css 'pointer-events: none' to disable click 
events on the player while the player is being dragged.

https://github.com/OdyseeTeam/odysee-frontend/issues/206
2021-11-08 12:51:03 +01:00
infinite-persistence
0f1d4039a9
Use 'selectHasChannel' instead of the full 'selectMyChannelClaims'
- selectMyChannelClaims depends on `byId`, which currently is always invalidated per update, so it is not memoized.

- Most of the use-cases just needs the ID or the length of the array anyways, so avoid generating a Claim array (in selectMyChannelClaims) unnecessarily -- the client need to reduce it back down to IDs again :/

- The simpler boolean also removes the need to memoize the selector, which saves a bit of memory.
2021-11-08 15:02:44 +08:00
jessopb
238a64bca9
improve playlists display (#232)
* improve playlists display

* fix pagination

* reset page on filter button

* pagination updates if page param changes

* carry collection active tab to playlists page
2021-11-05 21:00:27 -04:00
saltrafael
fc2e2d2cfc
Stickers/emojis fall out / improvements (#220)
* Fix error logs

* Improve LBC sticker flow/clarity

* Show inline error if custom sticker amount below min

* Sort emojis alphabetically

* Improve loading of Images

* Improve quality and display of emojis and fix CSS

* Display both USD and LBC prices

* Default to LBC tip if creator can't receive USD

* Don't clear text-field after sticker is sent

* Refactor notification component

* Handle notifications

* Don't show profile pic on sticker livestream comments

* Change Sticker icon

* Fix wording and number rounding

* Fix blurring emojis

* Disable non functional emote buttons
2021-11-05 15:31:51 -04:00
mayeaux
7cae754867
smarter tab selection functionality (#231) 2021-11-05 15:27:43 -04:00
mayeaux
6cb011ff96
bugfix persisted state issue (#228)
* bugfix persisted state issue

* bugfix and also set defaults properly
2021-11-05 11:45:19 -04:00
infinite-persistence
17903f6c15
Limit to 10 superchats initially; batch-resolve when opening full list. 2021-11-04 16:30:51 +08:00
infinite-persistence
a65e68d023
Comments: use the lighter selectMyClaimIdsRaw
`selectMyActiveClaims` includes pending claims, so it gets invalidated often.

For the case of comment-filtering, we don't care about pending or abandoned own claims.
2021-11-04 16:30:50 +08:00
infinite-persistence
61a2ed2583
Simplify superchat selectors - memo not required
... since there are no transformations.
2021-11-04 16:06:06 +08:00
infinite-persistence
4876ad8671
Don't invalidate myClaimIds everytime 2021-11-04 16:06:05 +08:00
infinite-persistence
59db2860d7
Comments: use the lighter selectMyClaimIdsRaw
`selectMyActiveClaims` includes `byId`, which gets invalidated on each resolve. Having this as an input selector breaks memoization.

For the case of comment-filtering, we don't really care about pending or abandoned own claims (I think), so just grab the raw IDs.
2021-11-04 16:06:04 +08:00
infinite-persistence
531a87e969
channelThumbnail: don't resolve if already in process 2021-11-04 16:04:29 +08:00
infinite-persistence
60a0d6d31a
Use replace instead of replaceAll for browser compatibility (#222)
Also, moved the `replaced` outside of the find-loop so that we don't re-run it each time.
2021-11-04 00:56:29 -04:00
Dan Peterson
11d3f88654
WIP: live stream kill switch (#209)
* WIP: live stream kill switch

* Update hint layout / style

* update livestream API endpoint

* use the no-cors option
2021-11-03 17:52:18 -04:00
Thomas Zarebczan
db12a4b991
Odysee specific changes and other misc improvements (#219) 2021-11-03 15:47:19 -04:00
Rodion Borisov
6d8e265f50
Transform route-leading menu items to hyperlinks (#191) 2021-11-03 15:50:03 +01:00
infinite-persistence
7b621b7417
Add option to hide buildUri warnings
No point for it to keep appearing if nobody cares?

Anyway, added option to hide it via environment variable for those who are annoyed by it.
2021-11-03 13:01:13 +08:00
infinite-persistence
3d1d448afb
Fix crash with ModalError
## Issue
There was one instance of ModalError that wasn't wrapped in the Suspense.

## Fix
- Moved `getModal` outside to make the code cleaner. Due to the length of `getModal`, I didn't notice the early return statement.
- Fix ModalError's Suspense.
2021-11-03 10:09:01 +08:00
infinite-persistence
bf0aac2339
URI parsing improvements (#207)
* Prevent multiple parseURI calls

## Ticket
129

## Issue
Code was shortened to use `isURIValid` during the consolidation. `isURIValid` calls `normalizeURI`, which calls another `parseURI`.

`parseURI` is pretty expensive.

## Approach
- Add optional parameter to `isURIValid` to skip the normalization.
- Set those that were converted during the consolidation to skip the normalization. Also covered a few other instances where it is obvious to me that normalization is not required.
- For the rest, I can't tell for sure if it's safe to remove the normalization, so the default `normalize=true` will leave things as is.

The whole `parseURI` probably needs a refactoring, or a few lighter version for specific needs.

* Simplify isURIEqual

## Issue
`parseURI` is too expensive to be used in a loop, plus `normalizeURI` itself is calling `parseURI`.

## Approach
Not sure if it covers all cases, but just try convert colons to hashes before comparing.
2021-11-02 12:37:53 -04:00
Dan Peterson
704452732a
Add hints if an error occurs subscribing to notifications (#143)
* Add hints if an error occurs subscribing to notifications

* Update import (type/linting issue)

* disable optimization for debugging

* Revert "disable optimization for debugging"

This reverts commit 5b837f94e97b7488a7dc565e7f74d399e19c286f.

* improve detection of notification support + improve ux / ui surrounding that

* update translations
2021-11-01 14:51:23 -04:00
jessopb
fa029e0c09
channel parsing bugfix (#199) 2021-11-01 09:58:28 -04:00
infinite-persistence
56b800cd33
Fix 'secondary.js' code coverage
## Issue
95% of `secondary.js` is unused code.
  - It was meant to reduce network overhead by chunking up files needed after bootup, and also to reduce the number of `vendor-*.js` files.
  - But it ended up accidentally grabbing everything, defeating the purpose of code-splitting.
2021-11-01 15:25:40 +08:00
infinite-persistence
b8399f10b2
Fix lint/auto-formatting... 2021-11-01 15:23:08 +08:00