mirror of
https://github.com/bitwarden/browser
synced 2026-01-03 17:13:47 +00:00
[PM-5539] Migrate ThemingService (#8219)
* Update ThemingService * Finish ThemingService * Lint * More Tests & Docs * Refactor to ThemeStateService * Rename File * Fix Import * Remove `type` added to imports * Update InitServices * Fix Test * Remove Unreferenced Code * Remove Unneeded Null Check * Add Ticket Link * Add Back THEMING_DISK * Fix Desktop * Create SYSTEM_THEME_OBSERVABLE * Fix Browser Injection * Update Desktop Manual Access * Fix Default Theme * Update Test
This commit is contained in:
15
apps/desktop/src/platform/utils/from-ipc-system-theme.ts
Normal file
15
apps/desktop/src/platform/utils/from-ipc-system-theme.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { defer, fromEventPattern, merge } from "rxjs";
|
||||
|
||||
import { ThemeType } from "@bitwarden/common/platform/enums";
|
||||
|
||||
/**
|
||||
* @returns An observable watching the system theme via IPC channels
|
||||
*/
|
||||
export const fromIpcSystemTheme = () => {
|
||||
return merge(
|
||||
defer(() => ipc.platform.getSystemTheme()),
|
||||
fromEventPattern<ThemeType>((handler) =>
|
||||
ipc.platform.onSystemThemeUpdated((theme) => handler(theme)),
|
||||
),
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user