Whalebird-desktop-client-ma.../renderer/utils/invoke.tsx

15 lines
337 B
TypeScript
Raw Normal View History

2024-03-08 13:05:59 +01:00
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
}
}