Page MenuHomePhabricator

[native] handle successful connection from connect farcaster bottom sheet
ClosedPublic

Authored by ginsu on Apr 9 2024, 10:04 AM.
Tags
None
Referenced Files
F3392366: D11598.id38988.diff
Sat, Nov 30, 8:27 AM
F3391614: D11598.diff
Sat, Nov 30, 4:53 AM
Unknown Object (File)
Sun, Nov 3, 8:22 AM
Unknown Object (File)
Oct 12 2024, 8:50 PM
Unknown Object (File)
Oct 12 2024, 8:50 PM
Unknown Object (File)
Oct 12 2024, 8:50 PM
Unknown Object (File)
Oct 12 2024, 8:50 PM
Unknown Object (File)
Oct 12 2024, 8:49 PM
Subscribers

Details

Summary

In this diff we handle successfully connecting to farcaster from the connect farcaster bottom sheet. The behavior for this is to set the fid in the fid context and then close the bottomsheet.

cc @will who is working on updating all FIDProvider usages with synced metadata store (https://linear.app/comm/issue/ENG-7590/replace-all-fidprovider-usages-with-synced-metadata-store)

Linear task: https://linear.app/comm/issue/ENG-7520/introduce-onpressconnectfarcastercallback

Depends on D11597

Test Plan

Please see the demo video below

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ginsu edited the test plan for this revision. (Show Details)
ginsu added reviewers: atul, inka.
ginsu edited the summary of this revision. (Show Details)
ginsu added a subscriber: will.
native/components/connect-farcaster-bottom-sheet.react.js
72 ↗(On Diff #38949)

Calling the close() method for this bottomsheet in this useEffect is intentional. onSuccessfulConnect will be called immediately once the user still signs in, even if they are still on warpcast. This causes some janky animation where if the user is slow to going back to Comm the bottom sheet will all of a sudden disappear. This useEffect will ensure that the bottom sheet will only close as soon as the fid was successfully set AND the user has returned to Comm

ginsu retitled this revision from handle successful connection from connect farcaster bottom sheet to [native] handle successful connection from connect farcaster bottom sheet.
ginsu requested review of this revision.Apr 9 2024, 10:19 AM
This revision is now accepted and ready to land.Apr 9 2024, 10:24 PM
native/components/connect-farcaster-bottom-sheet.react.js
61 ↗(On Diff #38949)

What is the point of defining this callback?

native/components/connect-farcaster-bottom-sheet.react.js
61 ↗(On Diff #38949)

Thought it would be easier to read + easier to modify the logic if we ever wanted to extend this callback; however, can also just pass setFID directly into FarcasterWebView if that is what is preferred

native/components/connect-farcaster-bottom-sheet.react.js
61 ↗(On Diff #38949)

I'm okay either way, but would probably lean towards using setFID directly, unless you have plans to extend the callback already