Files
cherry-studio/src/preload/simplest.ts
T
fullex 39257f64b1 feat(migration): enhance migration UI and refactor layout
This commit updates the migration window dimensions for improved usability, sets explicit entry points for preload scripts, and enhances the overall layout of the migration interface. It introduces new styles for buttons and alerts, improves the structure of the migration steps, and refines the user experience with clearer feedback and options during the migration process.
2025-08-10 13:51:08 +08:00

18 lines
565 B
TypeScript

import { electronAPI } from '@electron-toolkit/preload'
import { contextBridge } from 'electron'
// Use `contextBridge` APIs to expose Electron APIs to
// renderer only if context isolation is enabled, otherwise
// just add to the DOM global.
if (process.contextIsolated) {
try {
contextBridge.exposeInMainWorld('electron', electronAPI)
} catch (error) {
// eslint-disable-next-line no-restricted-syntax
console.error('[Preload]Failed to expose APIs:', error as Error)
}
} else {
// @ts-ignore (define in dts)
window.electron = electronAPI
}