1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 09:13:33 +00:00

[PM-3677] Remove ipcRenderer from desktop utils (#6477)

* [PM-3677] Remove ipcRenderer from utils

* Fix typo
This commit is contained in:
Daniel García
2023-11-09 12:48:18 +01:00
committed by GitHub
parent 929a08339f
commit 7f7700f5f5
5 changed files with 17 additions and 10 deletions

View File

@@ -1,5 +1,3 @@
import { ipcRenderer } from "electron";
export type RendererMenuItem = {
label?: string;
type?: "normal" | "separator" | "submenu" | "checkbox" | "radio";
@@ -10,7 +8,7 @@ export function invokeMenu(menu: RendererMenuItem[]) {
const menuWithoutClick = menu.map((m) => {
return { label: m.label, type: m.type };
});
ipcRenderer.invoke("openContextMenu", { menu: menuWithoutClick }).then((i: number) => {
ipc.platform.openContextMenu(menuWithoutClick).then((i: number) => {
if (i !== -1) {
menu[i].click();
}
@@ -82,7 +80,3 @@ export function cleanUserAgent(userAgent: string): string {
.replace(userAgentItem("Bitwarden", " "), "")
.replace(userAgentItem("Electron", " "), "");
}
export async function getCookie(url: string, name: string): Promise<Electron.Cookie[]> {
return await ipcRenderer.invoke("getCookie", { url: url, name: name });
}