HomePhabricator
Diffusion Comm 0ce162712b13

[native] fix error handling in TagFarcasterChannelByName

Description

[native] fix error handling in TagFarcasterChannelByName

Summary:
As I am working on bringing the channel tagging UI to web, I noticed that I did not properly handle all the error states for the TagFarcasterChannelByName screen. At the moment, we only check if the input given by the user is a valid farcaster channel name; however, atm we don't have any logic handling if something went wrong during the create farcaster channel tag keyserver call.

There was also another issue, where the user would be taken back to previous screen even if the something went wrong during the create farcaster channel tag keyserver call. To address this, I introduced a new optional param to useCreateFarcasterChannelTag where we can include logic through a callback to be called only when we successfully finish the create farcaster channel tag keyserver call, (in this case going back to the previous screen).

Depends on D12541

Test Plan:
Confirmed that if I passed invalid parameters or if I entered a valid farcaster channel name that has already been tagged to another community, then I would get the correct expected error message

Screenshot 2024-06-21 at 4.24.50 PM.png (1×1 px, 699 KB)

Confirmed that we only go back to the previous screen when we successfully finish the create farcaster channel tag keyserver call

Reviewers: kamil, inka

Reviewed By: inka

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D12542

Details

Provenance
ginsuAuthored on Jun 24 2024, 10:24 AM
Reviewer
inka
Differential Revision
D12542: [native] fix error handling in TagFarcasterChannelByName
Parents
rCOMMeb88aad04d8d: [native] handle loading state in TagFarcasterChannelByName
Branches
Unknown
Tags
Unknown