mirror of
https://github.com/bitwarden/browser
synced 2025-12-21 10:43:35 +00:00
[PM-6564] migrate auth toasts to CL toastService (#10665)
* migrate auth toasts to CL toastService * fix component args * fix component args * fix specs * fix toastService args
This commit is contained in:
@@ -6,6 +6,7 @@ import { EnvironmentService } from "@bitwarden/common/platform/abstractions/envi
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||
import { ToastService } from "@bitwarden/components";
|
||||
|
||||
@Component({
|
||||
selector: "app-accessibility-cookie",
|
||||
@@ -25,6 +26,7 @@ export class AccessibilityCookieComponent {
|
||||
protected environmentService: EnvironmentService,
|
||||
protected i18nService: I18nService,
|
||||
protected ngZone: NgZone,
|
||||
private toastService: ToastService,
|
||||
) {}
|
||||
|
||||
registerhCaptcha() {
|
||||
@@ -42,28 +44,28 @@ export class AccessibilityCookieComponent {
|
||||
}
|
||||
|
||||
onCookieSavedSuccess() {
|
||||
this.platformUtilsService.showToast(
|
||||
"success",
|
||||
null,
|
||||
this.i18nService.t("accessibilityCookieSaved"),
|
||||
);
|
||||
this.toastService.showToast({
|
||||
variant: "success",
|
||||
title: null,
|
||||
message: this.i18nService.t("accessibilityCookieSaved"),
|
||||
});
|
||||
}
|
||||
|
||||
onCookieSavedFailure() {
|
||||
this.platformUtilsService.showToast(
|
||||
"error",
|
||||
null,
|
||||
this.i18nService.t("noAccessibilityCookieSaved"),
|
||||
);
|
||||
this.toastService.showToast({
|
||||
variant: "error",
|
||||
title: null,
|
||||
message: this.i18nService.t("noAccessibilityCookieSaved"),
|
||||
});
|
||||
}
|
||||
|
||||
async submit() {
|
||||
if (Utils.getHostname(this.accessibilityForm.value.link) !== "accounts.hcaptcha.com") {
|
||||
this.platformUtilsService.showToast(
|
||||
"error",
|
||||
this.i18nService.t("errorOccurred"),
|
||||
this.i18nService.t("invalidUrl"),
|
||||
);
|
||||
this.toastService.showToast({
|
||||
variant: "error",
|
||||
title: this.i18nService.t("errorOccurred"),
|
||||
message: this.i18nService.t("invalidUrl"),
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.listenForCookie = true;
|
||||
|
||||
Reference in New Issue
Block a user