Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions app/lib/pages/onboarding/find_device/found_devices.dart
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,12 @@ class _FoundDevicesState extends State<FoundDevices> {
if (!provider.isConnected) ..._devicesList(provider),
if (provider.isConnected)
Text(
'${provider.deviceName} (${BtDevice.shortId(provider.deviceId)})',
() {
final sameNameCount = provider.deviceList.where((d) => d.name == provider.deviceName).length;
return sameNameCount > 1
? '${provider.deviceName} (${BtDevice.shortId(provider.deviceId)})'
: provider.deviceName;
}(),
textAlign: TextAlign.center,
style: const TextStyle(
fontWeight: FontWeight.w500,
Expand Down Expand Up @@ -316,7 +321,10 @@ class _FoundDevicesState extends State<FoundDevices> {
Align(
alignment: Alignment.centerLeft,
child: Text(
'${device.name} (${device.getShortId()})',
() {
final sameNameCount = provider.deviceList.where((d) => d.name == device.name).length;
return sameNameCount > 1 ? '${device.name} (${device.getShortId()})' : device.name;
}(),
textAlign: TextAlign.left,
style: const TextStyle(
fontWeight: FontWeight.w500,
Expand Down
16 changes: 13 additions & 3 deletions app/lib/utils/device.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,25 @@ class DeviceUtils {
return Assets.images.friendPendant.path;
case DeviceType.omi:
// For omi type, need to check model/name to distinguish between devkit and regular omi
if (modelNumber != null && modelNumber.isNotEmpty && modelNumber.toUpperCase() != 'UNKNOWN') {
if (modelNumber != null && modelNumber.isNotEmpty && modelNumber.toUpperCase() != 'UNKNOWN') {
final upperModel = modelNumber.toUpperCase();
if (upperModel.contains('DEVKIT') || upperModel.contains('FRIEND')) {

if (upperModel.contains('GLASS')) {
return Assets.images.omiGlass.path;
}

if (upperModel.contains('DEVKIT') || (upperModel.contains('FRIEND'))) {
return Assets.images.omiDevkitWithoutRope.path;
}
}
if (deviceName != null && deviceName.isNotEmpty) {
final upperName = deviceName.toUpperCase();
if (upperName.contains('DEVKIT') || upperName.contains('DEV') || upperName.contains('FRIEND')) {

if (upperName.contains('GLASS')) {
return Assets.images.omiGlass.path;
}

if (upperName.contains('DEVKIT') || upperName.contains('DEV') || (upperName.contains('FRIEND'))) {
return Assets.images.omiDevkitWithoutRope.path;
}
}
Expand Down