Page MenuHomePhabricator

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

Authored by ginsu on Tue, Apr 9, 10:04 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 22, 5:47 PM
Unknown Object (File)
Mon, Apr 22, 3:49 PM
Unknown Object (File)
Mon, Apr 22, 4:19 AM
Unknown Object (File)
Sun, Apr 21, 4:03 AM
Unknown Object (File)
Wed, Apr 17, 8:45 AM
Unknown Object (File)
Tue, Apr 16, 2:11 AM
Unknown Object (File)
Mon, Apr 15, 12:21 PM
Unknown Object (File)
Mon, Apr 15, 10:22 AM
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.Tue, Apr 9, 10:19 AM
This revision is now accepted and ready to land.Tue, Apr 9, 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