Commit graph

291 commits

Author SHA1 Message Date
infinite-persistence
da691f286e
Assume weekly_watch is claimed when data is insufficient (#1806)
## Issue
If the reward-list fetch is slow, the selector assumes the weekly_watch hasn't been claimed yet, causing an unnecessary claim.

## Change
The selector now tells the caller if there is no data -- up to caller on what to do (in this case, don't claim the reward).

It should be harmless if the claim action was missed, since the user can still manually claim it.
2022-07-07 05:16:36 -04:00
infinite-persistence
02d017d415
Bump weekly-watch auto claim interval (#1794)
## Ticket
1768 Check reward claiming logic

## Change
- Bump to >6.5 days
- Remove unnecessary `Math.ceil` -- not sure why I added that. It was causing diff to hit earlier than necessary.

> _and I'm 5 days away._

Not sure how to replicate/explain this, though -- the old code would have still covered this range.  One possibility is when `last_claimed` is not defined, where we assume user hasn't claimed yet. We could flip this to assume "claimed" and just let the user manually claim as the fallback -- let me know.
2022-07-05 06:44:40 -04:00
infinite-persistence
dbb9ee7ac6
PremiumBadge: retrieve membership db internally instead of from parent (#1764)
* DRY up membership selector

Selectors should be chained up, not copy/pasted.

* PremiumBadge: retrieve membership db internally instead of from parent

## Ticket
1753 odyseeMembershipByUri function causing unnecessary renders

## Issue
While the rendering issue in the ticket is due to the way the props are defined, it also surfaced a prop-drilling issue with PremiumBadge.

Instead of asking the parent for the membership db, it can retrieve from Redux itself. This prevents the prop from polluting 2 levels of components and causing unnecessary renders.

## Approach
- Make `PremiumBadge` accept `uri` like most other components.
- I still leave the `membership` prop as (i.e. parent can still pass it directly). In some cases (e.g. `livestreamComment`, `page/odyseeMembership`), the parent itself needs the same data, so we don't need to derive it twice.
2022-07-01 15:40:06 -04:00
infinite-persistence
d3f95e256a
Recsys: add isEmbed to videos in Markdown (posts, comments) (#1765)
* Remove dead-end selector

`playingUri` resides in the `content` slice, so this returns nothing.
Nobody is using it, so should be safe to remove.

* Recsys: add `isEmbed` to videos in Markdown (posts, comments)

It seems like the existing `embedded` needs to specifically mean `/$/embed` (external from odysee.com), so had to add another variable.
2022-06-28 08:10:22 -04:00
mayeaux
de068d36f1
Preorder button touchups (#1755)
* update precommit hook

* touchup code per kps comments
2022-06-24 09:08:46 -04:00
mayeaux
4f47779303
Preorder content functionality (#1743)
* adding preorder button

* adding preorder modal

* frontend mostly done

* check if its already purchased

* refresh page after purchase

* smooth out purchase process

* check if user has card saved

* handle case where its the users own upload

* fix transaction listing order bug

* cleaning up code for merge

* fix lint errors

* fix flow errors

* allow eur purchases

* support eur on customer transaction page

* fix css
2022-06-23 20:58:32 -04:00
infinite-persistence
486a557d75
Recsys: capture and use x-uuid from search results (#1727)
* Recsys/FYP: add documentation.

* Recsys: capture and use `x-uuid` from search results

Ticket: 1717
2022-06-22 09:43:54 -04:00
infinite-persistence
ee3236fe1e
Recommendations: factor out a selector for raw results
1606
2022-06-21 22:14:07 +08:00
infinite-persistence
539cc062b6
DRY: fix duplicate code for Recommended key generation
Must use `getRecommendationSearchOptions`, otherwise there is a chance of some clients deriving the wrong key.
2022-06-21 22:14:07 +08:00
Thomas Zarebczan
5fe5f7599f Revert "DRY: fix duplicate code for Recommended key generation"
This reverts commit 05376490a8.
2022-06-01 09:55:56 -04:00
Thomas Zarebczan
4cf531b8ad Revert "Recommendations: factor out a selector for raw results"
This reverts commit 2edf1ca564.
2022-06-01 09:55:56 -04:00
infinite-persistence
2edf1ca564 Recommendations: factor out a selector for raw results
1606
2022-06-01 08:32:37 -04:00
infinite-persistence
05376490a8 DRY: fix duplicate code for Recommended key generation
Must use `getRecommendationSearchOptions`, otherwise there is a chance of some clients deriving the wrong key.
2022-06-01 08:32:37 -04:00
infinite-persistence
a73694deb4 Fix localStorage crash
## Ticket
1572
Always check for availability before use.

## Changes
- Consolidated the keys into one place for easier tracking.
  - It'll also be easier to code using constant autocomplete.
- Cleaned up the wrapper to be as close as the original.
- Updated existing code to use the wrapper (even if they already handled the availability) to encourage future code to just use the wrapper.
2022-05-26 08:27:35 -04:00
infinite-persistence
6d6d95237a 1318: Persist recsys data for send after tab close
- Add ability to store `entries` into Redux.
- Sync to redux in the same interval as when playing position is saved (re-use timer).
- On startup, send any stashed entries and clear them.
2022-05-24 13:52:50 -04:00
infinite-persistence
13729a2ed4 Comment: filter geo-restricted channels 2022-05-24 12:53:40 -04:00
infinite-persistence
426d1ea0c9 Factor out geo-restriction logic
No functional change.

Impetus is to make the logic re-usable for comment-blocking.
2022-05-24 12:53:40 -04:00
infinite-persistence
79eb28cc55
Add 'lastViewedAnnouncement' into wallet.
This stores the hash for the last viewed announcement.

The intention is so that the announcement won't re-appear when logging into another device.

However, this does mean that announcements would need to wait until the first sync to decide whether to appear or not, which can be quite a delay.
2022-05-20 00:04:06 +08:00
infinite-persistence
245eb39892
Add 'announcement' to v2 homepage api
This requires an accompanying commit in the homepages repo (see "Add announcement support").

Using `raw-loader` to import markdown files as a string works for the app-side, but didn't work well in web-side. Falling back to copying the announcement files to `dist` and reading them via `readFileSync`. Don't really like this -- will return with an alternative.
2022-05-20 00:04:05 +08:00
infinite-persistence
64225d2b80
Fix selector naming convention
ByUri - returns the storage variable (array or object).
ForUri - returns the specific entry in the storage variable.
2022-05-19 13:10:37 +08:00
infinite-persistence
96e704e5d9
Fix ContentState type 2022-05-18 14:32:30 +08:00
infinite-persistence
a2099482b0 Batch-resolve Watch History
## Issue
Doing individual resolves, even on a small list, is taxing.

## Change
Add infinite scroll and batch-resolve each page.
2022-05-16 07:57:24 -04:00
Rafael
7c68fd1e61 Remove active livestream condition
- meaningless since its supposed to be a permanent link either way
2022-05-16 06:36:50 -04:00
Rafael
239bde0752 Also add support for embeds 2022-05-16 06:36:50 -04:00
Rafael
6b2427768c Add ability to link to latest or current live channel file pages
- and some changes to activeLivestream redux since it would return undefined if fetching and no claim, so now it returns null when no activeLivestream is found
2022-05-16 06:36:50 -04:00
saltrafael
b75a4014b6
Re-design comment threads (#1489)
* Redesign threadline and fetching state

- threadline goes right below channel avatar, mimicking reddits implementation, has a increase effect on hover and is slimmer, creating more space for comments on screen
- fetching state now replaces show/hide button, also mimicking reddit, and now says that it is loading, instead of a blank spinner, and also improves space a bit

* Redesign comment threads

- Allow for infinite comment chains
- Can go back and forth between the pages
- Can go back to all comments or to the first comment in the chain
- Some other improvements, which include:
- add title on non-drawer comment sections (couldn't see amount of comments)
- fix Expandable component (would begin expanded and collapse after the effect runs, which looked bad and shifted the layout, now each comments greater than the set length begins collapsed)
- used constants for consistency

* Fix replying to last thread comment

* Fix buttons condition (only on fetched comment to avoid deleted case)

* Fix auto-scroll

* Bring back instant feedback for Show More replies

* Improve thread back links

- Now going back to all comments links the top-level comment for easier navigation
- Going back to ~ previous ~ now goes back into the chain instead of topmost level

* Clear timeouts due to unrelated issue

* Fix deep thread linked comment case and more scroll improvements

* More minor changes

* Flow

* Fix commentList tile style

* Fix long channel names overflowing on small screens

* More scroll changes

* Fix threadline

* Revert "Fix long channel names overflowing on small screens"

This reverts commit e4d2dc7da5861ed8136a60f3352e41a690cd4d33.

* Fix replies fetch

* Revert "Fix replies fetch"

This reverts commit ec70054675a604a7a5f3764ba07c36bf7b0f49c8.

* Cleanup and make smooth

* Always use linked comment on threads

* Cleanup

* Higlight thread comment

* Fix comment body styles
2022-05-16 06:22:13 -04:00
infinite-persistence
72b0977817 Recsys: pass isFollowing and incognito
Additional data requested.

isFollowing - is the user following the creator
incognito - authenticated or not
2022-05-12 18:35:20 -04:00
Thomas Zarebczan
71894daf49
Fix crash on middle click (and others?) 2022-05-10 13:25:47 -04:00
infinite-persistence
8874008245 Support homepage-specific memes
1446

- Requires an accompanying commit in `odysee-frontend`.
- The change assumes that the `odysee-frontend` is the only project that uses these files directly, i.e. other clients will use the API instead.
2022-05-10 21:43:14 +08:00
infinite-persistence
dae78c488f Stacked toast view
From the previous commit, we are now showing toasts in the reverse order (latest to oldest).

Next, extend the "hide snack" timer to handle multiple snacks. It will dismiss them one by one, restarting itself until no more toasts.

Show a stacked GUI when there are multiple toasts.

Users can still manually dismiss the toasts.
2022-05-06 13:53:39 -04:00
infinite-persistence
55916f0763 Revert the toast display order
New toasts should be displayed immediately.
2022-05-06 13:53:39 -04:00
infinite-persistence
2bdae7637b Fix comment_create verification
## Why
Lost in a rebase. The GUI clamping was just meant to complement this (so that user knows what's going on), but ended up being the only thing that was pushed.

## Changes
- If the fetch failed or still in progress, we ask the user to wait or simply refresh the page.
- If already commented from another channel, bail and inform via Toast.
2022-05-06 11:31:42 -04:00
Rafael
f191cf0b88 Fix default channel changing with active channel on header 2022-05-05 11:24:22 -04:00
Rafael
7eb5eb9996 Add channel selector on HeaderMenuButton
- Moved from reach/ui to material/ui menu components, because reach ui wouldn't work with 2 menus
- This channel selector stores the default on settings
- setActiveChannelIfNotSet was deprecated, if the account has channels, it will always return a channel even if there is no active channel or stored channel
2022-05-05 11:24:22 -04:00
Rafael
fa1f3abbdc Allow selecting an active channel by default 2022-05-05 11:24:22 -04:00
infinite-persistence
cd2998d695
Membership-name state updates
- Corrected flow definitions.
- Properly differentiate between "not yet fetched" and "no membership" as "undefined" and "<empty string>", respectively. There are GUI elements that need to know the unfetched case.
2022-05-04 10:45:58 +08:00
infinite-persistence
29a68eb992 1075: Fetch list of my channels that have commented on a claim 2022-05-02 16:07:00 -04:00
Rafael
129a5819d9 Refactor and fix websocket connection behavior 2022-04-29 10:43:30 -04:00
Rafael
0dccabe692 Selector change
- and remove from where it was unused
2022-04-20 09:18:43 -04:00
infinite-persistence
3f805a6189 doCheckPublishNameAvailability: case-insensitive version
## Issue
??

## Behavioral Changes
- Use `claim_search` instead of `claim_list` to retrieve all all own claims with the same name (case-insensitive).
  - Caveat: annonymous posts will be excluded.
- When a clash occurs, there is a possibility that we have multiple existing entries (e.g. "xxX", "xXx"). Since we don't know which one is best to fall back, I removed the "edit" button for this and replaced with a simpler text

## Code Note
- If not mistaken, the rest of the code still needs `selectMyClaimForUri` to be case-sensitive, so augment the selector to support both through an optional parameter.
2022-04-18 00:44:11 -04:00
infinite-persistence
2f6b7f0ba6 Update app to use v2 homepage api 2022-04-15 09:25:08 -04:00
Rafael
65b9906086 Add dynamic player aspect ratio resizing 2022-04-07 11:44:25 -04:00
infinite-persistence
491c934119 Fix makeSelectContentPositionForUri memo
- Move away from the leaky makeSelect* pattern.
- No memoization since it's pretty light.
2022-04-01 09:58:09 -04:00
infinite-persistence
a96db41782 FYP: show placeholder tiles when fetching membership or fyp itself.
This prevents the "no membership" and "no recommendations" message from flashing during load.
2022-03-23 23:21:46 -04:00
infinite-persistence
db38cc597f Quick membership override in debug mode 2022-03-23 09:23:02 -04:00
Rafael
dcb19a9f48 Improve wording for CA 2022-03-23 09:16:52 -04:00
saltrafael
05b228400e
Fix referrer on embed (#1181)
* Fix referrer on embed

* Fix override

* Fix condition
2022-03-22 14:13:19 -04:00
Rafael
bc3c56b84b Locale Nag Fixes 2022-03-21 09:36:59 -04:00
infinite-persistence
51079ea611 Consolidate legal/requirements fetch
Ticket: 1128

Requirements:
- Fetch once per refresh. This is to cover the case of switching to VPNs, etc.
- 1 call per refreshed session.
2022-03-17 10:25:59 -04:00
infinite-persistence
ec2bf26817
Fix flow for User/UserState 2022-03-17 13:12:18 +08:00