Archived
15 lines
508 B
JavaScript
15 lines
508 B
JavaScript
const { contextBridge, ipcRenderer } = require('electron')
|
|
|
|
contextBridge.exposeInMainWorld('desktopBridge', {
|
|
isDesktop: true,
|
|
notify(payload) {
|
|
if (!payload || typeof payload !== 'object') return
|
|
ipcRenderer.send('desktop:notify', {
|
|
title: typeof payload.title === 'string' ? payload.title : '',
|
|
body: typeof payload.body === 'string' ? payload.body : '',
|
|
conversationId:
|
|
typeof payload.conversationId === 'string' ? payload.conversationId : undefined,
|
|
})
|
|
},
|
|
})
|