1
0
mirror of https://github.com/h3poteto/whalebird-desktop synced 2024-12-28 17:52:17 +01:00
Whalebird-desktop-client-ma.../renderer/utils/invoke.tsx
2024-09-23 19:19:16 +09:00

17 lines
442 B
TypeScript

export function invoke(event: string, data: any): Promise<any> {
if (process.env.NEXT_PUBLIC_CLIENT_ENV !== 'browser') {
return global.ipc.invoke(event, data)
}
switch (event) {
case 'open-browser':
window.open(data, '_blank').focus()
return
case 'set-proxy':
console.warn('Can not use proxy in this environment')
return
default:
console.error(`Unknown event: ${event}`)
return
}
}