mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 22:03:36 +00:00
fix(devices): [PM-18757] resolve invalid device data error for Android devices
The device management screen was incorrectly evaluating the truthiness of DeviceView.type enum, causing "Invalid device data" errors when an Android device (type = 0) was present. Changed the check to explicitly verify for undefined values instead of truthy checks. - Updated type checking to use explicit undefined checks - Added translations for error messages - Improved error handling with specific messages for missing data Fixes PM-18757
This commit is contained in:
@@ -180,8 +180,20 @@ export class DeviceManagementComponent {
|
||||
private updateDeviceTable(devices: Array<DeviceView>): void {
|
||||
this.dataSource.data = devices
|
||||
.map((device: DeviceView): DeviceTableData | null => {
|
||||
if (!device.id || !device.type || !device.creationDate) {
|
||||
this.validationService.showError(new Error("Invalid device data"));
|
||||
if (device.id == undefined) {
|
||||
this.validationService.showError(new Error(this.i18nService.t("deviceIdMissing")));
|
||||
return null;
|
||||
}
|
||||
|
||||
if (device.type == undefined) {
|
||||
this.validationService.showError(new Error(this.i18nService.t("deviceTypeMissing")));
|
||||
return null;
|
||||
}
|
||||
|
||||
if (device.creationDate == undefined) {
|
||||
this.validationService.showError(
|
||||
new Error(this.i18nService.t("deviceCreationDateMissing")),
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user