diff --git a/assets/l10n/intl_en.arb b/assets/l10n/intl_en.arb index 3ac86d80..10875bf7 100644 --- a/assets/l10n/intl_en.arb +++ b/assets/l10n/intl_en.arb @@ -2517,5 +2517,6 @@ "letsStart": "Let's start", "enterInviteLinkOrMatrixId": "Enter invite link or Matrix ID...", "reopenChat": "Reopen chat", - "noBackupWarning": "Warning! Without enabling chat backup, you will lose access to your encrypted messages. It is highly recommended to enable the chat backup first before logging out." + "noBackupWarning": "Warning! Without enabling chat backup, you will lose access to your encrypted messages. It is highly recommended to enable the chat backup first before logging out.", + "noOtherDevicesFound": "No other devices found" } \ No newline at end of file diff --git a/lib/pages/device_settings/device_settings_view.dart b/lib/pages/device_settings/device_settings_view.dart index 5ac489fb..8b8f467d 100644 --- a/lib/pages/device_settings/device_settings_view.dart +++ b/lib/pages/device_settings/device_settings_view.dart @@ -69,6 +69,13 @@ class DevicesSettingsView extends StatelessWidget { ? null : () => controller.removeDevicesAction( controller.notThisDevice), + ) + else + Center( + child: Padding( + padding: const EdgeInsets.all(16.0), + child: Text(L10n.of(context)!.noOtherDevicesFound), + ), ), const Divider(height: 1), ], diff --git a/lib/pages/device_settings/user_device_list_item.dart b/lib/pages/device_settings/user_device_list_item.dart index 013b7e82..52cc6bf1 100644 --- a/lib/pages/device_settings/user_device_list_item.dart +++ b/lib/pages/device_settings/user_device_list_item.dart @@ -36,10 +36,10 @@ class UserDeviceListItem extends StatelessWidget { @override Widget build(BuildContext context) { - final keys = Matrix.of(context) - .client - .userDeviceKeys[Matrix.of(context).client.userID] + final client = Matrix.of(context).client; + final keys = client.userDeviceKeys[Matrix.of(context).client.userID] ?.deviceKeys[userDevice.deviceId]; + final isOwnDevice = userDevice.deviceId == client.deviceID; return ListTile( onTap: () async { @@ -51,7 +51,7 @@ class UserDeviceListItem extends StatelessWidget { key: UserDeviceListItemAction.rename, label: L10n.of(context)!.changeDeviceName, ), - if (keys != null) ...{ + if (!isOwnDevice && keys != null) ...{ SheetAction( key: UserDeviceListItemAction.verify, label: L10n.of(context)!.verifyStart, @@ -69,11 +69,12 @@ class UserDeviceListItem extends StatelessWidget { isDestructiveAction: true, ), }, - SheetAction( - key: UserDeviceListItemAction.remove, - label: L10n.of(context)!.delete, - isDestructiveAction: true, - ), + if (!isOwnDevice) + SheetAction( + key: UserDeviceListItemAction.remove, + label: L10n.of(context)!.delete, + isDestructiveAction: true, + ), ], ); if (action == null) return;