mirror of
https://github.com/h3poteto/whalebird-desktop
synced 2024-12-25 16:23:19 +01:00
15 lines
337 B
TypeScript
15 lines
337 B
TypeScript
export function invoke(event: string, data: any) {
|
|
if (process.env.NEXT_PUBLIC_CLIENT_ENV !== 'browser') {
|
|
global.ipc.invoke(event, data)
|
|
return
|
|
}
|
|
switch (event) {
|
|
case 'open-browser':
|
|
window.open(data, '_blank').focus()
|
|
return
|
|
default:
|
|
console.error(`Unknown event: ${event}`)
|
|
return
|
|
}
|
|
}
|