Fix name/subtitle for device.

This commit is contained in:
Dain Nilsson 2022-12-21 16:13:32 +01:00
parent e19f1a3bc5
commit 0b98312c14
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8
2 changed files with 5 additions and 1 deletions

View File

@ -236,6 +236,10 @@ class _CurrentDeviceRow extends StatelessWidget {
orElse: () => DeviceAvatar.deviceNode(node, radius: 64), orElse: () => DeviceAvatar.deviceNode(node, radius: 64),
); );
final messages = getDeviceMessages(node, data); final messages = getDeviceMessages(node, data);
// Reader name is same as Device name on Android:
if (messages.first == messages.last) {
messages.removeLast();
}
return Column( return Column(
children: [ children: [

View File

@ -44,7 +44,7 @@ List<String> getDeviceMessages(DeviceNode? node, AsyncValue<YubiKeyData> data) {
case 'unknown-device': case 'unknown-device':
return ['Unrecognized device']; return ['Unrecognized device'];
case 'device-inaccessible': case 'device-inaccessible':
return ['Device inaccessible']; return [node.name, 'Device inaccessible'];
} }
return null; return null;
}, },