Page MenuHomePhabricator

[native] only display remove device button if current device is primary device
Needs RevisionPublic

Authored by varun on Fri, Sep 6, 10:45 AM.
Tags
None
Referenced Files
F2707541: D13262.id.diff
Sun, Sep 15, 12:02 PM
Unknown Object (File)
Fri, Sep 13, 5:36 PM
Unknown Object (File)
Fri, Sep 13, 1:38 PM
Unknown Object (File)
Fri, Sep 13, 4:59 AM
Unknown Object (File)
Wed, Sep 11, 6:54 PM
Unknown Object (File)
Fri, Sep 6, 9:50 PM
Unknown Object (File)
Fri, Sep 6, 9:50 PM
Unknown Object (File)
Fri, Sep 6, 9:50 PM
Subscribers
None

Details

Summary

pretty self-explanatory. only the primary device should be able to remove other devices. we hide the remove device button if user is not on their primary device.

Test Plan

confirmed that the button only appears if i'm on my primary device

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

varun requested review of this revision.Fri, Sep 6, 11:02 AM
native/profile/linked-devices-list-item.react.js
20–22

Can't you reuse isPrimary? Their values should be equal

native/profile/linked-devices.react.js
38–40

Not sure which way of determining primary device is better:

  • The one based on index (simple)
  • The one you introduced with effect (I guess more reliable?)
65

Nit, kinda unrelated: if we need only deviceID, getContentSigningKey() doesn't require Identity context

ashoat requested changes to this revision.Mon, Sep 9, 12:43 PM
ashoat added inline comments.
native/profile/linked-devices-bottom-sheet.react.js
142

Should be avoided for the same reasons described for ternary here

native/profile/linked-devices.react.js
38–40

I think just using the index is better

This revision now requires changes to proceed.Mon, Sep 9, 12:43 PM