Skip to content

Commit

Permalink
Fix platform translation in device management component to handle "Un…
Browse files Browse the repository at this point in the history
…known" platform correctly
  • Loading branch information
alec-livefront committed Dec 23, 2024
1 parent 3934101 commit 4bb0459
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,11 @@ export class DeviceManagementComponent {
return this.i18nService.t("unknownDevice");

Check warning on line 150 in apps/web/src/app/auth/settings/security/device-management.component.ts

View check run for this annotation

Codecov / codecov/patch

apps/web/src/app/auth/settings/security/device-management.component.ts#L150

Added line #L150 was not covered by tests
}

// If the platform is "Unknown" translate it since it is not a proper noun
const platform =
metadata.platform === "Unknown" ? this.i18nService.t("unknown") : metadata.platform;
const category = this.i18nService.t(metadata.category);

Check warning on line 156 in apps/web/src/app/auth/settings/security/device-management.component.ts

View check run for this annotation

Codecov / codecov/patch

apps/web/src/app/auth/settings/security/device-management.component.ts#L156

Added line #L156 was not covered by tests
return metadata.platform ? `${category} - ${metadata.platform}` : category;
return platform ? `${category} - ${platform}` : category;
}

/**
Expand Down

0 comments on commit 4bb0459

Please sign in to comment.