HomePhabricator
Diffusion Comm ac4273c9cb0d

[native] Update registrationMode from state to ref

Description

[native] Update registrationMode from state to ref

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

Reviewers: atul, ginsu

Reviewed By: atul

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D8153

Details

Provenance
ashoatAuthored on Jun 4 2023, 9:45 AM
Reviewer
atul
Differential Revision
D8153: [native] Update registrationMode from state to ref
Parents
rCOMM1839f0e2efd3: [native] Set user avatar after registering in registration flow
Branches
Unknown
Tags
Unknown