mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 22:03:36 +00:00
[PM-3682] Remove ipcRenderer from login-approval (#6838)
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
import { Component, OnInit, OnDestroy } from "@angular/core";
|
import { Component, OnInit, OnDestroy } from "@angular/core";
|
||||||
import { ipcRenderer } from "electron";
|
|
||||||
import { Subject } from "rxjs";
|
import { Subject } from "rxjs";
|
||||||
|
|
||||||
import { ModalRef } from "@bitwarden/angular/components/modal/modal.ref";
|
import { ModalRef } from "@bitwarden/angular/components/modal/modal.ref";
|
||||||
@@ -76,13 +75,13 @@ export class LoginApprovalComponent implements OnInit, OnDestroy {
|
|||||||
this.updateTimeText();
|
this.updateTimeText();
|
||||||
}, RequestTimeUpdate);
|
}, RequestTimeUpdate);
|
||||||
|
|
||||||
const isVisible = await ipcRenderer.invoke("windowVisible");
|
const isVisible = await ipc.platform.isWindowVisible();
|
||||||
if (!isVisible) {
|
if (!isVisible) {
|
||||||
await ipcRenderer.invoke("loginRequest", {
|
await ipc.auth.loginRequest(
|
||||||
alertTitle: this.i18nService.t("logInRequested"),
|
this.i18nService.t("logInRequested"),
|
||||||
alertBody: this.i18nService.t("confirmLoginAtemptForMail", this.email),
|
this.i18nService.t("confirmLoginAtemptForMail", this.email),
|
||||||
buttonText: this.i18nService.t("close"),
|
this.i18nService.t("close")
|
||||||
});
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,11 @@ import { ipcRenderer } from "electron";
|
|||||||
export default {
|
export default {
|
||||||
getHcaptchaAccessibilityCookie: (): Promise<[string]> =>
|
getHcaptchaAccessibilityCookie: (): Promise<[string]> =>
|
||||||
ipcRenderer.invoke("getCookie", { url: "https://www.hcaptcha.com/", name: "hc_accessibility" }),
|
ipcRenderer.invoke("getCookie", { url: "https://www.hcaptcha.com/", name: "hc_accessibility" }),
|
||||||
|
|
||||||
|
loginRequest: (alertTitle: string, alertBody: string, buttonText: string): Promise<void> =>
|
||||||
|
ipcRenderer.invoke("loginRequest", {
|
||||||
|
alertTitle,
|
||||||
|
alertBody,
|
||||||
|
buttonText,
|
||||||
|
}),
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user