Page MenuHomePhabricator

D13747.diff
No OneTemporary

D13747.diff

diff --git a/native/profile/linked-devices-list-item.react.js b/native/profile/linked-devices-list-item.react.js
--- a/native/profile/linked-devices-list-item.react.js
+++ b/native/profile/linked-devices-list-item.react.js
@@ -69,16 +69,21 @@
const label = React.useMemo(() => {
const baseLabel = deviceID.substr(0, 7);
- let finalLabel = baseLabel;
+ const labelAttributes = [];
if (isPrimary) {
- finalLabel += ' (primary)';
+ labelAttributes.push('primary');
}
-
if (isThisDevice) {
- finalLabel += ' (this device)';
+ labelAttributes.push('this device');
+ }
+
+ if (labelAttributes.length === 0) {
+ return baseLabel;
}
+ const joinedAttributes = labelAttributes.join(', ');
+ const finalLabel = `${baseLabel} (${joinedAttributes})`;
return finalLabel;
}, [deviceID, isPrimary, isThisDevice]);

File Metadata

Mime Type
text/plain
Expires
Fri, Oct 18, 10:21 PM (20 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2320010
Default Alt Text
D13747.diff (887 B)

Event Timeline