mirror of
https://github.com/bitwarden/browser
synced 2025-12-20 02:03:39 +00:00
[PM-3681] Remove ipcRenderer from lock.component (#6479)
* [PM-3681] Remove ipcRenderer from lock.component * Break out biometric method into two separate functions
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { ipcRenderer } from "electron";
|
||||
|
||||
import { DeviceType, ThemeType } from "@bitwarden/common/enums";
|
||||
import { DeviceType, ThemeType, KeySuffixOptions } from "@bitwarden/common/enums";
|
||||
|
||||
import { BiometricMessage, BiometricAction } from "../types/biometric-message";
|
||||
import { isDev, isWindowsStore } from "../utils";
|
||||
@@ -29,6 +29,13 @@ const passwords = {
|
||||
};
|
||||
|
||||
const biometric = {
|
||||
enabled: (userId: string): Promise<boolean> =>
|
||||
ipcRenderer.invoke("biometric", {
|
||||
action: BiometricAction.EnabledForUser,
|
||||
key: `${userId}_user_biometric`,
|
||||
keySuffix: KeySuffixOptions.Biometric,
|
||||
userId: userId,
|
||||
} satisfies BiometricMessage),
|
||||
osSupported: (): Promise<boolean> =>
|
||||
ipcRenderer.invoke("biometric", {
|
||||
action: BiometricAction.OsSupported,
|
||||
@@ -58,6 +65,8 @@ export default {
|
||||
ipcRenderer.on("systemThemeUpdated", (_event, theme: ThemeType) => callback(theme));
|
||||
},
|
||||
|
||||
isWindowVisible: (): Promise<boolean> => ipcRenderer.invoke("windowVisible"),
|
||||
|
||||
getLanguageFile: (formattedLocale: string): Promise<object> =>
|
||||
ipcRenderer.invoke("getLanguageFile", formattedLocale),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user