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
Unknown Object (File)
Sat, Jun 29, 3:20 AM
Unknown Object (File)
Fri, Jun 28, 2:53 PM
Unknown Object (File)
Thu, Jun 27, 3:21 AM
Unknown Object (File)
Fri, Jun 21, 4:57 AM
Unknown Object (File)
Fri, Jun 21, 4:57 AM
Unknown Object (File)
Wed, Jun 19, 4:07 PM
Unknown Object (File)
Wed, Jun 19, 4:06 PM
Unknown Object (File)
Wed, Jun 19, 9:49 AM
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
Lint Not Applicable
Unit
Tests Not Applicable

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.