Page MenuHomePhabricator

[native] Update registrationMode from state to ref
ClosedPublic

Authored by ashoat on Jun 8 2023, 7:00 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 18, 2:21 AM
Unknown Object (File)
Thu, Apr 18, 2:21 AM
Unknown Object (File)
Thu, Apr 18, 2:21 AM
Unknown Object (File)
Thu, Apr 18, 2:17 AM
Unknown Object (File)
Feb 23 2024, 7:12 PM
Unknown Object (File)
Feb 23 2024, 7:01 PM
Unknown Object (File)
Feb 23 2024, 6:05 PM
Unknown Object (File)
Feb 23 2024, 4:00 PM
Subscribers

Details

Summary

Since we only ever do "spot checks" of this state, and don't need to pass it as a dep somewhere in order to make it auto-update, we should probably use a ref instead of state.

The advantage is that performance is better since fewer things need to be recalculated.

I originally did this because the registration call was using an version of the setUserAvatar call that was bound before registration, and it wasn't getting the updated registrationMode after the previous diff. I ended up having to separate the avatar-setting code anyways (as other things were getting bound in, such as the cookie)... but I still think this change is a good one, for the performance reasons described above.

Depends on D8152

Test Plan

Flow. Also earlier when I was calling setUserAvatar right after registration, this change made it so the server call would actually hit the keyserver, instead of being filtered out on the client because registrationMode was on

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable