From 39341019182c71afb5711ce1819f07d779569f48 Mon Sep 17 00:00:00 2001 From: Alec Rippberger Date: Fri, 20 Dec 2024 17:40:33 -0600 Subject: [PATCH] Use ValidationService to handle error --- .../settings/security/device-management.component.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/web/src/app/auth/settings/security/device-management.component.ts b/apps/web/src/app/auth/settings/security/device-management.component.ts index a2450fa1cd0..5a27f42416a 100644 --- a/apps/web/src/app/auth/settings/security/device-management.component.ts +++ b/apps/web/src/app/auth/settings/security/device-management.component.ts @@ -8,6 +8,7 @@ import { DevicesServiceAbstraction } from "@bitwarden/common/auth/abstractions/d import { DeviceView } from "@bitwarden/common/auth/abstractions/devices/views/device.view"; import { DeviceType, DeviceTypeMetadata } from "@bitwarden/common/enums"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; +import { ValidationService } from "@bitwarden/common/platform/abstractions/validation.service"; import { DialogService, ToastService, TableDataSource, TableModule } from "@bitwarden/components"; import { SharedModule } from "../../../shared"; @@ -43,6 +44,7 @@ export class DeviceManagementComponent { private devicesService: DevicesServiceAbstraction, private dialogService: DialogService, private toastService: ToastService, + private validationService: ValidationService, ) { this.devicesService .getCurrentDevice$() @@ -202,12 +204,8 @@ export class DeviceManagementComponent { message: this.i18nService.t("deviceRemoved"), variant: "success", }); - } catch (e) { - this.toastService.showToast({ - title: "", - message: this.i18nService.t("errorOccurred"), - variant: "warning", - }); + } catch (error) { + this.validationService.showError(error); } } }