1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-04 09:33:27 +00:00

[PM-3683] Remove ipcRenderer from electron-platform-utils (#6679)

* [PM-3683] Remove ipcRenderer from electron-platform-utils

* FIx review comments

* Formatting

* Use isNullOrWhitespace
This commit is contained in:
Daniel García
2023-11-01 18:34:36 +01:00
committed by GitHub
parent a1729c97df
commit c592bcba80
9 changed files with 112 additions and 46 deletions

View File

@@ -1,9 +1,20 @@
import * as path from "path";
import { app, dialog, ipcMain, Menu, MenuItem, nativeTheme, session, Notification } from "electron";
import {
app,
dialog,
ipcMain,
Menu,
MenuItem,
nativeTheme,
session,
Notification,
shell,
} from "electron";
import { ThemeType } from "@bitwarden/common/enums";
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
import { SafeUrls } from "@bitwarden/common/platform/misc/safe-urls";
import { WindowMain } from "../main/window.main";
import { RendererMenuItem } from "../utils";
@@ -68,6 +79,12 @@ export class ElectronMainMessagingService implements MessagingService {
alert.show();
});
ipcMain.handle("launchUri", async (event, uri) => {
if (SafeUrls.canLaunch(uri)) {
shell.openExternal(uri);
}
});
nativeTheme.on("updated", () => {
windowMain.win?.webContents.send(
"systemThemeUpdated",