diff --git a/apps/desktop/src/auth/login/login-approval.component.ts b/apps/desktop/src/auth/login/login-approval.component.ts index 807059107f..4fee03eb8a 100644 --- a/apps/desktop/src/auth/login/login-approval.component.ts +++ b/apps/desktop/src/auth/login/login-approval.component.ts @@ -1,5 +1,4 @@ import { Component, OnInit, OnDestroy } from "@angular/core"; -import { ipcRenderer } from "electron"; import { Subject } from "rxjs"; import { ModalRef } from "@bitwarden/angular/components/modal/modal.ref"; @@ -76,13 +75,13 @@ export class LoginApprovalComponent implements OnInit, OnDestroy { this.updateTimeText(); }, RequestTimeUpdate); - const isVisible = await ipcRenderer.invoke("windowVisible"); + const isVisible = await ipc.platform.isWindowVisible(); if (!isVisible) { - await ipcRenderer.invoke("loginRequest", { - alertTitle: this.i18nService.t("logInRequested"), - alertBody: this.i18nService.t("confirmLoginAtemptForMail", this.email), - buttonText: this.i18nService.t("close"), - }); + await ipc.auth.loginRequest( + this.i18nService.t("logInRequested"), + this.i18nService.t("confirmLoginAtemptForMail", this.email), + this.i18nService.t("close") + ); } } } diff --git a/apps/desktop/src/auth/preload.ts b/apps/desktop/src/auth/preload.ts index f4180406af..91321d62d8 100644 --- a/apps/desktop/src/auth/preload.ts +++ b/apps/desktop/src/auth/preload.ts @@ -3,4 +3,11 @@ import { ipcRenderer } from "electron"; export default { getHcaptchaAccessibilityCookie: (): Promise<[string]> => ipcRenderer.invoke("getCookie", { url: "https://www.hcaptcha.com/", name: "hc_accessibility" }), + + loginRequest: (alertTitle: string, alertBody: string, buttonText: string): Promise => + ipcRenderer.invoke("loginRequest", { + alertTitle, + alertBody, + buttonText, + }), };