Update all non-major dependencies
[ProtonMail-WebClient.git] / applications / pass-desktop / src / lib / theming.ts
blobeef7fce340c0090e555cd4dc427ef88d0d2afee2
1 import { ipcMain, nativeTheme } from 'electron';
3 import type { DesktopTheme } from '@proton/pass/types';
5 import { store } from '../store';
7 export const setTheme = (theme: DesktopTheme) => {
8     store.set('theme', theme);
9     nativeTheme.themeSource = theme;
12 export const getTheme = () => store.get('theme') ?? 'system';
14 export const setupIpcHandlers = () => {
15     ipcMain.handle('theming:setTheme', (_, theme: DesktopTheme) => setTheme(theme));
16     ipcMain.handle('theming:getTheme', getTheme);