mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-11 22:29:38 +00:00
Restructure
This commit is contained in:
19
src-electron/ipc/OpenURLHandler.ipc.ts
Normal file
19
src-electron/ipc/OpenURLHandler.ipc.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { shell } from 'electron'
|
||||
|
||||
import { IPCEmitHandler } from '../shared/IPCHandler'
|
||||
|
||||
/**
|
||||
* Handles the 'open-url' event.
|
||||
*/
|
||||
class OpenURLHandler implements IPCEmitHandler<'open-url'> {
|
||||
event = 'open-url' as const
|
||||
|
||||
/**
|
||||
* Opens `url` in the default browser.
|
||||
*/
|
||||
handler(url: string) {
|
||||
shell.openExternal(url)
|
||||
}
|
||||
}
|
||||
|
||||
export const openURLHandler = new OpenURLHandler()
|
||||
Reference in New Issue
Block a user