Page MenuHomePhabricator

[native] prevent leaving restore screen when falling back to v1
ClosedPublic

Authored by kamil on Feb 24 2025, 6:34 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 2, 10:05 AM
Unknown Object (File)
Wed, Apr 2, 9:09 AM
Unknown Object (File)
Tue, Apr 1, 11:07 PM
Unknown Object (File)
Tue, Apr 1, 7:25 PM
Unknown Object (File)
Tue, Apr 1, 3:20 PM
Unknown Object (File)
Tue, Apr 1, 12:01 PM
Unknown Object (File)
Mon, Mar 17, 11:26 AM
Unknown Object (File)
Fri, Mar 14, 5:34 PM
Subscribers

Details

Summary

Part of ENG-10240.

Using the same approach as for Register account screen - moved this logic to a hook to avoid code duplication.

Depends on D14398

Test Plan

Same test plan as for D14398 but on RestorePasswordAccountScreen and RestorePromptScreen.

Tested on physical iOS and physical Android.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil held this revision as a draft.
kamil edited the test plan for this revision. (Show Details)
kamil published this revision for review.Feb 24 2025, 6:48 AM
tomek added inline comments.
native/account/restore-prompt-screen.react.js
102 ↗(On Diff #47231)

Will this action work after this diff? Won't it get blocked by the hook?

native/navigation/use-prevent-user-from-leaving-screen.js
17–26 ↗(On Diff #47231)

What's the difference between setting the header to null and to undefined?

This revision is now accepted and ready to land.Feb 24 2025, 8:44 AM
native/navigation/use-prevent-user-from-leaving-screen.js
17–26 ↗(On Diff #47231)

I might be wrong, but I think undefined resets default behavior (the back button is present) and null disables the back button

native/account/restore-prompt-screen.react.js
102 ↗(On Diff #47231)

It works, but after looking at this we realize goBack here doesn't make much sense, we should just remove it, see the video below:

The user should still be on the same screen.

native/navigation/use-prevent-user-from-leaving-screen.js
17–26 ↗(On Diff #47231)

Yes, this code was copied so context in https://phab.comm.dev/D11849#inline-70733

This revision was landed with ongoing or failed builds.Feb 25 2025, 4:34 AM
This revision was automatically updated to reflect the committed changes.