Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintain like state when navigating between screens #5095

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

haileyok
Copy link
Contributor

@haileyok haileyok commented Sep 2, 2024

Why

We're using a WeakMap right now for our post thread shadow, which is a bit annoying. The way we use it, we use a PostView as the key for lookups, which is generally fine but causes problems when navigating between screens. For example:

Screen.Recording.2024-09-02.at.3.09.09.PM.mov

This happens because the PostView that we get in response to getPostThread is not the same as the PostView that was seen in the feed.

Test Plan

Since here we use just the post's URI as a key, we get the expected behavior of "keeping" the like whenever transition between screens

Screen.Recording.2024-09-02.at.3.11.30.PM.mov

Copy link

render bot commented Sep 2, 2024

Copy link

github-actions bot commented Sep 2, 2024

Old size New size Diff
7.09 MB 7.09 MB 4 B (0.00%)

@haileyok haileyok marked this pull request as draft September 2, 2024 22:19
@haileyok haileyok force-pushed the hailey/persist-like-state branch from d4be906 to 1b82c76 Compare September 2, 2024 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant