Page MenuHomePhabricator

[native] implement onPressSave keyserver button callback
ClosedPublic

Authored by ginsu on Oct 31 2023, 9:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jul 5, 8:48 PM
Unknown Object (File)
Thu, Jul 4, 10:35 AM
Unknown Object (File)
Wed, Jul 3, 2:46 PM
Unknown Object (File)
Wed, Jul 3, 9:59 AM
Unknown Object (File)
Sun, Jun 30, 5:24 AM
Unknown Object (File)
Sat, Jun 29, 7:05 PM
Unknown Object (File)
Wed, Jun 26, 4:21 PM
Unknown Object (File)
Mon, Jun 17, 1:01 PM
Subscribers

Details

Summary

This diff implements onPressSave keyserver button. This callback will create the payload necessary for this action and dispatch the add keyserver redux action we just introduced with the payload we just created. For now we will just use the current user id as the keyserver admin user id until ENG-5282 is done and returns a userID

In a subsequent diff we will implement validation that will be used before we introduce the keyserver

Linear task: https://linear.app/comm/issue/ENG-5338/dispatch-addkeyserver-redux-action

Depends on D9664

Test Plan

Please see the demo video below

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ginsu added reviewers: inka, rohan, michal.
ginsu requested review of this revision.Oct 31 2023, 9:52 PM
native/profile/add-keyserver.react.js
35–41 ↗(On Diff #32579)

Wouldn't it make sense to fill in the default values in the reducer?

native/profile/add-keyserver.react.js
35–41 ↗(On Diff #32579)

Why?

native/profile/add-keyserver.react.js
35–41 ↗(On Diff #32579)

To reduce the amount of data in the payload. Just as a memory optimisation. Since I expect we will always be using the default values for those fields in addKeyserver action

native/profile/add-keyserver.react.js
35–41 ↗(On Diff #32579)

I don't think we need to be concerned about the memory usage of this object. It appears to be very small

In general, we should focus on readability / simplicity unless there's a legitimate performance concern (eg. a performance impact that will affect the user)

Overoptimizing for performance by reducing 5 params to 2 or something is not really productive in my opinion

inka added inline comments.
native/profile/add-keyserver.react.js
35–41 ↗(On Diff #32579)

Okay, that's fair

This revision is now accepted and ready to land.Nov 7 2023, 6:35 AM

update after @inka's recently landed diffs

native/profile/add-keyserver.react.js
41 ↗(On Diff #32986)

This was the only thing that I needed to update