Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3518435
D13747.id45268.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
887 B
Referenced Files
None
Subscribers
None
D13747.id45268.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 23, 8:03 PM (11 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2696162
Default Alt Text
D13747.id45268.diff (887 B)
Attached To
Mode
D13747: [native] Improve device labels on device list screen
Attached
Detach File
Event Timeline
Log In to Comment