Commit graph

2349 commits

Author SHA1 Message Date
infinite-persistence
c8ad9718bb
Floating player position-listener fixes (#289)
## Issues
- 251 Dragging the floating player is super laggy

Recent changes and/or refactoring combined the effects or added dependancies into the effects, causing them to re-run excessively.

## Changes
- Restored effects to their original behavior.
- Don't perform the position check when dragging -- only do it when released.
- Do proper debouncing for the 'resize' listener -- the previous method was incorrect as a new function is created on each render.
2021-11-15 16:13:48 -05:00
infinite-persistence
38c13cf5ef Skip USER_STATE_POPULATE when sync_hash is the same
## Changes
- doHandleSyncComplete: only call doGetAndPopulatePreferences when there is new data.
- But for that to work, we'll need to populate preferences at least once. We'll do that in doSignIn.
- We can also remove the "sync/prefs ready" mechanism that was mainly meant for Desktop.

Then came another problem: while trying to spark changes between 2 tabs, `sync/get` was saying "no change" despite the local and server hash being different. I think it is because the both `sync_hash + sync/get` combo is operating on server data, so the hash is the same. I'm guessing this is why we ended up just running doGetAndPopulatePreferences every time before PR, since this flag wasn't correct in this scenario.

- Updated `data.changed` to consider both API results and comparison with local hash.
2021-11-15 07:06:39 -08:00
mayeaux
6546eaeb63
refactor ad code and dont show ads on embeds (#290) 2021-11-15 10:01:42 -05:00
infinite-persistence
93c28b24bb Remove desktop video start time analytics 2021-11-15 09:25:58 +08:00
infinite-persistence
6d217dbc50
Attempt to speed up sidebar menu for mobile (#283)
* Exclude default homepage data at compile time

The youtuber IDs alone is pretty huge, and is unused in the `CUSTOM_HOMEPAGE=true` configuration.

* Remove Desktop items and other cleanup

- Moved constants out of the component.
- Remove SIMPLE_SITE check.
- Remove Desktop-only items

* Sidebar: limit subscription and tag section

## Issue
Too slow for huge lists

## Change
Limit to 10 initially, and load everything on "Show more"

* Fix makeSelectThumbnailForUri

- Fix memo
- Expose function to extract directly from claim if client already have it.
2021-11-12 10:59:11 -05:00
mayeaux
529a9cbc40
Videojs component refactor (#240)
* pull out ads into its own file

* final touchup

* pull out lbry volume class

* using curried function

* coming along well

* almost done keyboard shortcuts

* pulling the guts out

* finishing keyboard shortcuts

* coming along well

* running but needs some testing

* almost done but could still use some testing

* all code working with some flow fixes needed

* fixing flow errors

* finishing flow errors
2021-11-12 09:56:46 -05:00
infinite-persistence
6f8758c819
Fix and optimize makeSelectIsSubscribed (#273)
## Issues with `makeSelectIsSubscribed`
- It will not return true if the uri provided is canonical, because the compared subscription uri is in permanent form. This was causing certain elements like the Heart to not appear in claim tiles.
- It is super slow for large subscriptions not just because of the array size + being a hot selector, but also because it is looking up the claim twice (not memo'd) and also calling `parseURI` to determine if it's a channel, which is unnecessary if you already have the claim.

## Changes
- Optimize the selector to only look up the claim once, and make operations using already-obtained info.
2021-11-12 09:47:07 -05:00
infinite-persistence
ef0329e03b Lazy-load comment components
## Issue
~300KB savings in `ui.js` size (production, uncompressed). Mostly coming from the emoji library.

## Notes
Most of the `Comment*` components are under `CommentsList` or `LivestreamComments`, so deferring these 2 covered most of it. The exceptions are Notification and OwnComments.
2021-11-11 15:09:28 -05:00
infinite-persistence
0f68bad3eb
Optimize selectClaimIsMine
## Why
Frequently used; top in perf profile

## Changes
Most of the time, you already have the claim object in the current context. `selectClaimIsMineForUri` will retrieve the claim again, which is wasteful, even if it is memoized (looking up the cache still takes time).

Break apart the logic and added the alternative `selectClaimIsMine` for faster lookup.
2021-11-11 16:10:06 +08:00
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
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
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
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
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
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
531a87e969
channelThumbnail: don't resolve if already in process 2021-11-04 16:04:29 +08: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
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
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
jessopb
0aa6cc7e5a
limit collections to show to 24 (#147)
* limit collections to show to 24

A user had many collections. 
Since we have a search field, we can limit to 24.

* const
2021-10-29 10:53:56 -04:00
jessopb
f956f9d2fe
Fix cover upload ux (#184)
* do not block submit on thumb or cover error

* improve cover upload UX

* p padding
2021-10-29 10:53:46 -04:00
infinite-persistence
08c6df434e
Add "Go Live" to mobile (#183)
* Add "Go Live" button to mobile menu

* Move "Go Live" all the way to the top
2021-10-29 09:04:43 -04:00
infinite-persistence
11bbd58e33
General-purpose "Confirm" modal
Added a re-usable "yes/no" confirmation modal where the client just sets the question string and gets a callback "OK" or "Cancel" is clicked.

It doesn't make sense to create one modal for each confirmation, especially when the modal is only used in one place.

Replaced one of the existing modal as an example.
2021-10-29 13:36:27 +08:00
saltrafael
5f1f702490
[New Feature] Stickers (#131)
* Refactor filePrice

* Refactor Wallet Tip Components

* Add backend sticker support for comments

* Add stickers

* Refactor commentCreate

* Add Sticker Selector and sticker comment creation

* Add stickers display to comments and hyperchats

* Fix wrong checks for total Super Chats
2021-10-28 16:25:34 -04:00
infinite-persistence
4b0a06cef7
Ensure filter is not expanded when disabled (#153)
## Issue
- Go to a channel page
- Go to Wild West
- Back
- Expand the search filter (valid here)
- Forward

## Fix
Resolve the 'expanded' setting on mount to ensure it is never true when 'hideAdvancedFilter' is set.
2021-10-28 10:51:13 -04:00
mayeaux
00d28fe26e
fix bug where scrolling on video player page changes volume (#154) 2021-10-28 10:46:24 -04:00
infinite-persistence
cbedc4b933
ClaimPreviewSubtitle: fetch sub count only for channels 2021-10-28 13:11:25 +08:00
infinite-persistence
6b39fc1bbb
Make it easier for the next person to add View Count in specific pages. 2021-10-28 13:11:24 +08:00
infinite-persistence
f8f9b86cb4
FileViewCountInline: fix incorrect logic
4a22814c broke the intention of if-block (it essentially breaks the functionality in Search page if we enable view counts there in the future).

It also seems completely unrelated to the PR.
2021-10-28 13:11:23 +08:00
saltrafael
c24153c6ca
[New Feature] Comment Emotes (#125)
* Refactor form-field

* Create new Emote Menu

* Add Emotes

* Add Emote Selector and Emote Comment creation ability

* Fix and Split CSS
2021-10-27 14:20:47 -04:00
infinite-persistence
2922f0f2dc Revert "Code-split homepages"
This reverts commit 310fc81bd9.

Was breaking the `get` api
2021-10-28 01:33:46 +08:00
mayeaux
3849683a59
Lots of player UI improvements (#134)
* various control bar fixes

* fixes for mobile

* hide advertisement div by default

* fix duration bar

* more frontend touchups

* more styles

* fix for advertisement bar showing

* dont use ima on each re-render
2021-10-27 11:08:12 -04:00
infinite-persistence
247ee757d1
ChunkLoadError: ask user to reload instead of automatically reloading (#139)
## Issue
We previously automatically reload when there is a chunk error. This works fine if it's the case of new code was pushed recently while the user was active. But if the failure was caused by other things like network problems or the file IS actually missing, we end up in an infinite loop of refreshes.

## New approach
Tell the user to reload instead of automatically doing it.
2021-10-27 11:07:06 -04:00
Dan Peterson
03f69eff86
Browser push notifications (#133)
* fix type error

fix is subscribed check

- Persist subscription data locally
- add / remove subscription during log in / out
- Use store directly in hook

Add toast error if subscription fails

Revert removal of v2

hotfix linting issue

Add custom notification handler

- fix isSupported flag
- make icon color compatible with light/dark theme
- fix icon on notifications blocked banner

wip: add push notification banner to notifications page.

- ignore failed deletions via internal API
- add ua parsing package
- add more robust meta data to token save

refactor naming + add push toggle to notification button

shift some code around

update css naming o proper BEM notation

update notifications UI

remove now unneeded util function

Update push notification system to sue firebase sdk

separate service worker webpack bundling

update service worker to use firebase sdk

Add firebase config

Add firebase and remove filemanager

Stub out the basics for browser push notifications.

* fix safari

* try smaller image for badge

* add token validation with server, refactor code

* remove param

* add special icon for web notification badge

* add translations

* add missing trans for toast error

* add pushRequest method that will not prompt users who have subscribed but since disabled notifications in the settings.
2021-10-27 10:38:10 -04:00
infinite-persistence
310fc81bd9
Code-split homepages
## Ticket
97

## Issue
8% of the ui.js chunk consists of the 5 custom homepages
2021-10-27 07:55:24 +08:00
infinite-persistence
a90c516c71
Reduce impact of scanning blocklists (#121)
## Issue
- Each tile was checking against 4 blocklists (blacklisted, filtered, muted, commentron) on every render. Loading the front-page with Cheese alone caused 1400 calls.
- This is also part of the reason why pressing Back into the tile list takes forever.

## Fix
Since we still need to perform the checks at the app side for now, tried to memoize the operation through a selector.
2021-10-25 10:56:31 -04:00
infinite-persistence
e2176d0566
Don't connect to the Redux store when not needed.
The subscription still costs something per update cycle even when the parameters are null or empty objects.
2021-10-24 13:04:01 +08:00
infinite-persistence
b8c763f749
ClaimList: fix render due to un-memo'd callback. 2021-10-22 12:20:29 +08:00
infinite-persistence
b7685a151d
Additional GA events via redux/lbryio hook
## Issue
85 Add additional GA events

## Approach
Instead of placing analytic calls all over the GUI code (no separation of concerns), try to do it through a redux middleware instead.

## Changes
- Updated GA event and parameter naming after understanding how reporting works.
- Removed unused analytics.
2021-10-22 10:56:43 +08:00
Thomas Zarebczan
23525b0baa
FAQ stuff (#109) 2021-10-21 16:21:51 -04:00
mayeaux
c782f73f30
switch macro (#102)
* switch macro

* allow skip and other options
2021-10-20 11:14:33 -04:00
infinite-persistence
ce1621f7ed
Use selectClaimForUri in livestreams
Only picking components that are involved in a livestream for now. Ideally, all usages of `makeSelectClaimForUri` should be replaced -- will do it incrementally.
2021-10-20 11:29:18 +08:00
infinite-persistence
da63991972
Comment-selectors: fix memoization 2021-10-20 11:29:18 +08:00
infinite-persistence
5d8fc40051
Cache restoreScrollPos to avoid render
`CommentCreate` was getting marked for every comment that comes in because the parent was marked.
2021-10-20 11:29:17 +08:00
infinite-persistence
4b0318cd38
Optimize tags and followedTags
followedTags:
- Moved the filtering to the reducer side, so that we don't do it every time. We can't rely on `createSelector` because the store will be invalidated on each `USER_STATE_POPULATE`, unfortunately.

tags:
- Memoize via re-reselect for the "ForUri" selector.
2021-10-20 11:29:16 +08:00
infinite-persistence
0c2c21b67e
re-reselect proof of concept + fix Date selector as first example
## Issue
`makeSelectDataForUri` always returns a new reference, so `ClaimPreview` was constantly being rendered. It's pretty expensive since `ClaimPreview`'s rendering checks against a huge blocklist, which is another issue on it's own.

## Changes
- This commit tests the usage of `re-reselect` as the solution to the multi-instance memoization problem (https://github.com/toomuchdesign/re-reselect/blob/master/examples/1-join-selectors.md)
2021-10-20 11:29:15 +08:00
infinite-persistence
9bbd72d179
Fix reaction-selector reference invalidation
## Issue
When comments are refreshed, each `Comment` gets rendered 4-5 times due to reference invalidation for `othersReacts` (the data didn't actually change).

## Change
For selectors without transformation, there is no need to memoize using `createSelector` -- just access it directly. Also, don't do things like `return a[id] || {}` in a reducer, because the reference to the empty object will be different on each call.

Always return directly from the state so that the same reference is returned.

This simple change avoided the wasted resources needed for `createSelector`, and reduced to render to just 2 (initial render, and when reactions are fetched).
2021-10-19 21:15:26 +08:00
infinite-persistence
aabfc41ce9
Remove unused props and selector calls. 2021-10-19 21:15:25 +08:00
infinite-persistence
2a7f89d6b5
Post-merge updates and fixes
- Put back SETTINGS.LANGUAGE.
- Update import for `doResolveUris`.
2021-10-19 20:40:07 +08:00
Merge
30023422b8
Desktop cherry-pick: "7240 Integrate lbry redux and lbryinc" 2021-10-19 20:40:07 +08:00
GG2015
4a22814c75
Adds sub count to search and other areas. (#10)
Add follower counts to search
2021-10-16 14:12:09 -04:00
infinite-persistence
91be939c19
Fix linked-comment scrolling (again)
## Issue
Now that we batch-resolve the comment authors before displaying the comments, the linked-comment scrolling logic didn't work well with nested replies.

## Change
Previously, I didn't want to put the logic at the lowest level (`Comment`) because it was hard for the child to know whether to scroll or not. For example, we don't want to scroll when user changes the comment filters or presses the Refresh Comments button.

Relented and moved the logic to `Comment`, and pass a flag via `window` (I know this is frowned upon by some) to indicate whether a scrolling is needed.

This is probably more efficient overall as we don't need to scan the DOM, and with minimal delay as we scroll immediately after the linked-comment is mounted.

## Known issues
In markdown posts with lots of images, a layout shift due to delayed inline-image fetching can cause the scrolling to be inaccurate. This should be fixed by reserving space for markdown post images.
2021-10-16 13:40:33 +08:00
infinite-persistence
0b0f2848da
i18n - refix total comments
Meant to re-use strings, but I forgot to change the variable name.
2021-10-16 11:20:34 +08:00
Thomas Zarebczan
055d437865
fix total comments 2021-10-15 13:08:31 -04:00
infinite-persistence
d1493d5fb3
i18n 2021-10-15 14:23:40 +08:00
infinite-persistence
8498554f23
Improve aesthetics for deleted channel names.
## Issue
- Comments: no spacing between the strings.
- "Unused" is not intuitive.

## Changes
- Use "[Removed]" instead.
- Localization.
2021-10-14 22:29:50 +08:00
saltrafael
03ea298236
Fix expanding comments and scroll pagination 2021-10-14 21:05:01 +08:00
saltrafael
a3302b1be8
Fix expansion broken with layout change 2021-10-14 21:05:00 +08:00
saltrafael
58db9576b9
Fix infinite resolve 2021-10-14 21:04:59 +08:00
saltrafael
a9b9c3ccf0
Revert "Revert "[Comments] Batch resolve" (#61)"
This reverts commit 0e96f8d468.
2021-10-14 21:04:58 +08:00
infinite-persistence
ea516f88dc Fix 'setting.Get' runaway calls
## Issue
60 setting.Get calls spiked since October

It was called 24 times per livestream page load.

## Notes
The effect was intended to be a one-time effect, but the dependency was changed in 2f4dedfb
2021-10-14 20:26:11 +08:00
mayeaux
5f55a3f128
use insecure mode (#74) 2021-10-14 11:55:46 +03:00
mayeaux
6727e2766b
fix channel value (#67) 2021-10-13 19:07:57 +03:00
mayeaux
c10fc675db
fix channel value (#66) 2021-10-13 19:00:32 +03:00
mayeaux
fa889112c5
Ads setup (#62)
* re enable preload ads

* switch macro to aniview

* point towards test server

* improving documentation

* bugfix and turn skip back on

* only run twenty percent of the time for unauthed users

* allow for embeds

* enable show internal feature

* working prototype

* seems to work well

* bugfix

* review old aniview setup

* change to production channelid

* final touchups
2021-10-13 11:04:03 -04:00
infinite-persistence
0e96f8d468
Revert "[Comments] Batch resolve" (#61)
This reverts commit caadd889ce, reversing
changes made to 8b2c7a2b21.

## Issue
- Infinite `resolve` loop when deleted channel is present in the comments.
- Since it was only displayed comments with resolved channels, it masked away those comments. While that may or may not be regarded as a defect, I think we should do it at Commentron instead of at the app if we want to filter deleted channels. I vote to show comments from deleted channels, since it might have good conversation thread.
2021-10-13 08:59:32 -04:00
Bradley Ray
cd8f90c82d
added semicolon to import statement 2021-10-13 15:16:20 +08:00
Bradley Ray
24eb2ef8ec
change to import instead of redefining const 2021-10-13 15:16:19 +08:00
Bradley Ray
37ddc395ea
fixed disable-support for comments 2021-10-13 15:16:18 +08:00
saltrafael
7c518aa712
[Comment/Livestream] Markdown and style fixes (#55)
* Fix CSS for live chat embeds

* Fix Markdown Lists in Comments

* Disable copy link menu option on livestream comments

* Fix nested indents in Live Chat

* Fix mentions and timestamps not parsed in bullet lists

* Highlight livestream comment and menu button on hover

* Fix mention parsing
2021-10-12 17:06:20 -04:00
Anthony
3087f7c367
list 100 transactions for fiat received and outgoing instead of 25 2021-10-11 12:57:59 -04:00
saltrafael
620de2e6b7
Batch resolve replies 2021-10-11 08:35:50 +08:00
saltrafael
cafefb2a33
Refactor commentsReplies 2021-10-11 08:35:50 +08:00
saltrafael
f7cb39c496
Batch resolve comment list channels 2021-10-11 08:35:49 +08:00
infinite-persistence
9d48d9924d
Comments: expand replies for LC chain before mount instead of after
## Issue
40 Linked comments doesn't scroll for deep replies

## Notes
Don't need an effect for this, plus it was causing the parent to not pick it up for auto-scrolling.
2021-10-09 15:38:38 +08:00
Thomas Zarebczan
fc657d98d2
Sync language 2021-10-08 16:21:50 -04:00
Thomas Zarebczan
eaa32e4df4
Odysee references revamp, part1 2021-10-08 15:22:07 -04:00
infinite-persistence
b455e807bc
Disable timestamp parsing in livestream chat
## Issues
- The current version of the link handler doesn't seem able to control the livestream player's position.
- The "live" position is always 0:00 and everything behind it is a negative timestamp. The current timestamp parser doesn't handle negative values.
2021-10-08 17:59:05 +08:00
mayeaux
e3791aefdc
Send video bitrate and user bandwidth to Watchman (#7145)
* adding functionality to detect user download speed

* calculating bandwidth speed more intelligently

* saving download speed and updating it every 30s

* all the functionality should be done needs testing

* fix linting

* use a 1mb file for calculating bandwidth

* add optional chaining plugin to babel and get bitrate from texttrack

* allow optional chaining for flow

* ignore flow error

* disable bandwidth checking functionality

* fix flow error
2021-10-06 14:59:33 -04:00
zeppi
b44be39252 move file actions from lbry-redux 2021-10-06 10:22:49 -04:00
infinite-persistence
0be3154cbe
Fix playlist strings 2021-10-06 08:39:05 +08:00
saltrafael
256ed6a106
Remove expand/collapse from channel discussion page 2021-10-05 09:19:56 +08:00
saltrafael
fc2e08c882
Refactor commentsList 2021-10-05 09:19:56 +08:00
Dan Peterson
905a52ea61
adjust css for toast message so that it behaves as expected (text truncation via ellipsis) (#7213) 2021-10-04 09:21:59 -04:00
saltrafael
d6e14b84db
Add copy comment link menu option (#7224) 2021-10-04 09:20:37 -04:00
zeppi
f7b942fa42 patch hubs claims_in_channel temporarily 2021-10-02 14:01:22 -04:00
zeppi
d54976e461 patch creator analytics with hub without channel claim count 2021-10-02 13:29:46 -04:00
Thomas Zarebczan
aa0db24d0d
Temp workaround claims in channel count 0 2021-10-02 11:48:45 -04:00
Thomas Zarebczan
1cb0461991
Temp workaround SDK 0 count 2021-10-02 11:44:25 -04:00
infinite-persistence
11c9a53872
Fix 'pinnedUrl' error.
Part of "6989 Fix console spam in dev"

EXTRA_SIDEBAR_LINKS should be a `SideNavLink` object, so trim down the return object from `GetLinksData`.
2021-10-02 15:08:19 +08:00
saltrafael
56817d4e69
Fix resolving invalid claims (#7210) 2021-10-01 12:00:57 -04:00
infinite-persistence
de6c6f9bfd
List own comments (#7171)
* Add option to pass in url-search params.

Impetus: allow linked comment ID and setting the discussion tab when clicking on the `ClaimPreview`.

* comment.list: fix typos and renamed variables

- Switch from 'author' to 'creator' to disambiguate between comment author and content author. For comment author, we'll use 'commenter' from now on.
- Corrected 'commenterClaimId' to 'creatorClaimId' (just a typo, no functional change).

* doCommentReset: change param from uri to claimId

This reduces one lookup as clients will always have the claimID ready, but might not have the full URI.

It was using URI previously just to match the other APIs.

* Add doCommentListOwn -- command to fetch own comments

Since the redux slice is set up based on content or channel ID (for Channel Discussion page), re-use the channel ID for the case of "own comments". We always clear each ID when fetching page-0, so no worries of conflict when actually browsing the Channel Discussion page.

* Comment: add option to hide the actions section

* Implement own-comments page

* Use new param to remove sort-pins-first.

comment.List currently always pushes pins to the top to support pagination. This new param removes this behavior.
2021-10-01 08:10:27 -04:00
infinite-persistence
c71b90cecf
Fix linked-comment scrolling
I think this the best solution so far, at the expense of a slight delay in scrolling if the network call stalls.

- Added "fetching by ID" state so that we don't need to use the ugly N-retries method.
- `scrollIntoView` doesn't work if the element is already in the viewport, and the `scrollBy` adjustment doesn't take into account the y-position restoration that we perform on certain type of pages. Use `window.scrollTo` instead and taking into account current scroll position.
2021-10-01 15:51:05 +08:00
saltrafael
2f4dedfba2
Add Channel Mention selection ability (#7151)
* Add Channel Mention selection ability

* Fix mentioned user name being smaller than other text

* Improve logic for locating a mention

* Fix mentioning with enter on livestream

* Fix breaking for invalid URI query

* Handle punctuation after mention

* Fix name display and appeareance

* Use canonical url

* Fix missing search
2021-09-30 17:30:32 -04:00
saltrafael
81abae875f
Fix plant icon (#7195)
* Fix plant icon

* Also change phone icon name
2021-09-30 14:05:39 -04:00
Bradley Ray
819bdea0c6
fix playlist resolving collectionurls (#7178)
* fix playlist resolving collectionurls

* Update CHANGELOG.md

Co-authored-by: Thomas Zarebczan <tzarebczan@users.noreply.github.com>
2021-09-30 09:03:50 -04:00
saltrafael
26f80b0ec5
Add icons (#7194) 2021-09-30 09:01:24 -04:00
jessopb
fdd2d503d9
use homepage LATEST for following discover (#7185) 2021-09-29 15:22:46 -04:00
mayeaux
25b56ada48
Fix issue where channel upload viewcounts were creating a new line (#7154)
* fix issue where viewcounts were creating a new line

* conditionally add large view css

* conditionally apply class based on if view count should be shown

* last couple touchups

* clean up the css

* add scss to flow config

* add scss component to flow config
2021-09-29 15:04:43 -04:00
infinite-persistence
a8149fe9bb
Memoize 'mutedAndBlockedChannelIds'
It was being recalculated repeatedly.

This memoizes it, although it still re-calculates occasionally despite none of the source arrays changed. I think it is due to the state change in the Preference Sync.

Note: input selectors to `createSelector` needs to be extractions-only (i.e. must not have transformations). I think most of our `makeSelect*` selectors violate this and broke memoization.
2021-09-29 21:55:01 +08:00
infinite-persistence
b796ab3207
Fix missed render when blocklist is fetched
## Issue
7176

## Changes
Pitfalls of pausing render via React.memo:
  - We'll miss the `doClaimSearch()` since that is sparked by an `useEffect`.

Seems like we can't avoid having a redundant copy of the previously-displayed URIs.
2021-09-29 16:33:18 +08:00
infinite-persistence
3c0750a2a0
Fix homepage tiles not filtering blocked channels
## Ticket
7165 homepage queries don't take into account blocked channel ids (mute does)

## Changes
resolveSearchOptions: was not grabbing redux data correctly.
2021-09-25 13:14:08 +08:00
saltrafael
cc76a4a665
Fix video embeds in comments not playing and resize issues (#7163) 2021-09-24 11:53:17 -04:00
infinite-persistence
3b47edc3b9
Livestream category improvements (#7115)
*  Remove old method of displaying active livestreams

Completely remove it for now to make the commit deltas clearer.
We'll replace it with the new method at the end.

* Fetch and store active-livestream info in redux

* Tiles can now query active-livestream state from redux instead of getting from parent.

*  ClaimTilesDiscover: revert and cleanup

## Simplify
- Simplify to just `uris` instead of having multiple arrays (`uris`, `modifiedUris`, `prevUris`)
- The `prevUris` is for CLS prevention. With this removal, the CLS issue is back, but we'll handle it differently later.
- Temporarily disable the view-count fetching. Code is left there so that I don't forget.

## Fix
- `shouldPerformSearch` was never true when `prefixUris` is present. Corrected the logic.
- Aside: prefix and pin is so similar in function. Hm ....

* ClaimTilesDiscover: factor out options

## Change
Move the `option` code outside and passed in as a pre-calculated prop.

## Reason
To skip rendering while waiting for `claim_search`, we need to add `React.memo(areEqual)`. However, the flag that determines if we are fetching `claim_search` (fetchingClaimSearchByQuery[]) depends on the derived options as the key.

Instead of calculating `options` twice, we moved it to the props so both sides can use it.

It also makes the component a bit more readable.

The downside is that the prop-passing might not be clear.

* ClaimTilesDiscover: reduce ~17 renders at startup to just 2.

* ClaimTilesDiscover: fill with placeholder while waiting for claim_search

## Issue
Livestream claims are fetched seperately, so they might already exists. While claim_search is running, the list only consists of livestreams (collapsed).

## Fix
Fill up the space with placeholders to prevent layout shift.

* Add 'useFetchViewCount' to handle fetching from lists

This effect also stashes fetched uris, so that we won't re-fetch the same uris during the same instance (e.g. during infinite scroll).

*  ClaimListDiscover: revert and cleanup

## Revert
- Removed the 'finalUris' stuff that was meant to "pause" visual changes when fetching. I think it'll be cleaner to use React.memo to achieve that.

## Alterations
- Added `renderUri` to make it clear which array that this component will render.
- Re-do the way we fetch view counts now that 'finalUris' is gone. Not the best method, but at least correct for now.

* ClaimListDiscover: add prefixUris, similar to ClaimTilesDiscover

This will be initially used to append livestreams at the top.

*  Re-enable active livestream tiles using the new method

* doFetchActiveLivestreams: add interval check

- Added a default minimum of 5 minutes between fetches. Clients can bypass this through `forceFetch` if needed.

* doFetchActiveLivestreams: add option check

We'll need to support different 'orderBy', so adding an "options check" when determining if we just made the same fetch.

* WildWest: limit livestream tiles + add ability to show more

Most likely this behavior will change in the future, so we'll leave `ClaimListDiscover` untouched and handle the logic at the page level.

This solution uses 2 `ClaimListDiscover` -- if the reduced livestream list is visible, it handles the header; else the normal list handles the header.

* Use better tile-count on larger screens.

Used the same method as how the homepage does it.
2021-09-24 10:26:21 -04:00
infinite-persistence
0e391a3d78
Comment: Swap the order of "Edit" and "Remove"
This order is more common.
2021-09-24 10:00:37 +08:00
infinite-persistence
65d7e478ac
Don't allow assigning yourself as moderator
Also fixed split-string (hard to localize).
2021-09-24 09:57:24 +08:00
infinite-persistence
6658217865
Restore "Stream Key Button (#7127)" + lint and modifications
- Consolidate functionality into existing component.
- Use proper strings.
2021-09-23 20:13:02 +08:00
infinite-persistence
8bc8c4bcae
Revert "Stream Key Button (#7127)"
I forgot to lint before merging. Reverting for now, will fix in a bit.

This reverts commit 5c8878353f.
2021-09-23 17:57:49 +08:00
GG2015
5c8878353f
Stream Key Button (#7127)
* Added streamkey button.

* Added streamkey button.

* Updated changes

* Removed unused code.

* Removed copyableStreamkeyUnmask component.

* Rewrote StreamKeyMask to enableMask/enableMaskType

* Updated changelog and bumped version to 0.51.3

* Reverted changes

* Updated to correct area.

* Renamed CopyableText to CopyableStreamKey

* See commit notes.

* Fixed Show/Hide button
2021-09-23 14:17:59 +08:00
saltrafael
de6eb99d41
Fix channel name issue (#7153) 2021-09-22 11:28:32 -04:00
jessopb
8a277e767a
revert embedNoEnd and modify preferEmbed end display (#7144) 2021-09-21 12:47:56 -04:00
infinite-persistence
fcea4005eb
Fix incorrect context for 'New' string 2021-09-21 16:48:20 +08:00
infinite-persistence
31523d769a ClaimPreviewTile: render optimization
The `Date` object and blocklist arrays causes unnecessary render since their references are always different in the shallow-compare.
2021-09-21 09:15:41 +08:00
jessopb
432c40fb0c
embed preferred no end (#7138) 2021-09-20 18:37:27 -04:00
jessopb
7303abcda6
fix (#7137) 2021-09-20 17:06:55 -04:00
Alexander Schrier
eca9b2fcbf
Fix theater mode layout on small and medium screens (#7108)
* Fix theater mode layout on small and medium screens

* Make comments expandable on medium screens
2021-09-20 10:20:28 -04:00
infinite-persistence
0fc9cb9e73
Disable adv filters in "Find channels to follow" (#7130)
## Issue
7118 advanced filtering adjustments for channel related context
2021-09-20 10:19:34 -04:00
infinite-persistence
a199432b5c
Fix view-count showing up in non-Channel pages
## Issue
If you navigated to a Channel Page and returned to the homepage (or any page with ClaimPreview), the view-count is shown because we have that data.

## Fix
Instead of passing props around through the long "list" component chain (`ChannelContent -> ClaimListDiscover -> ClaimList -> ClaimPreview`) to indicate whether we should display it , just check the pathname at the lowest component level;  I believe eventually we would display it everywhere anyways, so this we'll be the easiest to clean up.
2021-09-20 09:28:58 +08:00
jessopb
6ca058c3a1
support embed preference (#7114)
* support embed preference

* title color
2021-09-18 10:23:30 -04:00
saltrafael
1c59913e7a
Recommended changes (#7089)
* Fix floating

* Change makeSelectRecommendedContentForUri behavior
2021-09-16 16:00:44 -04:00
infinite-persistence
f251ad999e
Handle view_count formatting on old browsers
## Issue
7102 Failed to initialize numberformat on some browsers

## Changes
Just revert to the non-SI notation (but still locale aware) for browsers that does not support the `compactDisplay` option.

I thought of adding an English-only abbreviation for that corner-case, but I think it's not worth the effort maintaining. There are worse issues happening on older browsers, such as icons not aligning properly in buttons and functions that require polyfilling.
2021-09-16 17:11:09 +08:00
infinite-persistence
d1c74ec997
Revert "Use SI notation for view_count ... bbcdcfe4"
It is breaking in old Safari 10. Revert for until; will get to a cleaner solution later.
2021-09-15 23:30:43 +08:00
jessopb
21ba7840ca
refactor collection thumbs and fix list channel updates (#7095)
* refactor collection thumbs

* collection update handle channels

* collection update handle channels more better

* bugfix
2021-09-15 10:11:01 -04:00
infinite-persistence
3e6743f3f4
Fix missing localization macro during refactoring
## Issues
https://discord.com/channels/362322208485277697/646840786662719488/887345736033918997

## Changes
I meant to only add the macro at the client call during the refactoring, but forgot.

Having said that, I now think it's cleaner to put the macro where it is defined, and it's easier for Translators to find, so I added the macro in the definition instead of at the client call.
2021-09-15 10:12:24 +08:00