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)
Tue, Nov 26, 4:33 PM
Unknown Object (File)
Tue, Nov 26, 3:06 PM
Unknown Object (File)
Oct 27 2024, 2:48 AM
Unknown Object (File)
Oct 15 2024, 4:15 PM
Unknown Object (File)
Oct 2 2024, 6:33 AM
Unknown Object (File)
Oct 2 2024, 6:33 AM
Unknown Object (File)
Oct 2 2024, 6:28 AM
Unknown Object (File)
Oct 2 2024, 3:22 AM
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
No Lint Coverage
Unit
No Test Coverage