SurfSense/surfsense_web/hooks/use-platform.ts
DESKTOP-RTLN3BA\$punk 49441233e7 feat: enhance keyboard shortcut management and improve app responsiveness
- Updated the development script to include a build step before launching the app.
- Refactored the registration of quick ask and autocomplete functionalities to be asynchronous, ensuring proper initialization.
- Introduced IPC channels for getting and setting keyboard shortcuts, allowing users to customize their experience.
- Enhanced the platform module to support better interaction with the Electron API for clipboard operations.
- Improved the user interface for managing keyboard shortcuts in the settings dialog, providing a more intuitive experience.
2026-04-07 00:43:40 -07:00

12 lines
434 B
TypeScript

import { useContext } from "react";
import { PlatformContext, type PlatformContextValue } from "@/contexts/platform-context";
export function usePlatform(): Pick<PlatformContextValue, "isDesktop" | "isWeb"> {
const { isDesktop, isWeb } = useContext(PlatformContext);
return { isDesktop, isWeb };
}
export function useElectronAPI(): ElectronAPI | null {
const { electronAPI } = useContext(PlatformContext);
return electronAPI;
}