Page MenuHomePhabricator

Extract shared logci for SIWE panel state handling
ClosedPublic

Authored by marcin on May 14 2024, 8:34 AM.
Tags
None
Referenced Files
F3389558: D12032.diff
Fri, Nov 29, 7:37 PM
Unknown Object (File)
Sun, Nov 10, 1:38 AM
Unknown Object (File)
Fri, Nov 1, 12:59 PM
Unknown Object (File)
Oct 15 2024, 5:39 PM
Unknown Object (File)
Oct 15 2024, 5:39 PM
Unknown Object (File)
Oct 15 2024, 5:39 PM
Unknown Object (File)
Oct 15 2024, 5:39 PM
Unknown Object (File)
Oct 15 2024, 5:39 PM
Subscribers

Details

Summary

The way ConnectEthereum and CreateSIWEBackupMessage handle SIWE panel state is exactly the same. Additionally getting signature for existing backup message will resuse this logic as well. Therefore this diff extracts it.

Test Plan

Test that SIWE registration, log in and backup message creation are unchanged.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil added inline comments.
native/account/siwe-hooks.js
159–165 ↗(On Diff #40315)

thinking about adding React.memo here but probably we will not gain much

This revision is now accepted and ready to land.May 20 2024, 1:54 AM
native/account/siwe-hooks.js
159–165 ↗(On Diff #40315)

It's probably a good idea. Given the current usages (where we destructure right after calling) there is no advantage to it. But it's good practice, and somebody in the future might call useSIWEPanelState without destructuring immediately

Add suggested memoization.