Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

electron-main-notification

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-main-notification - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

20

index.js

@@ -8,4 +8,4 @@ const { ipcMain, BrowserWindow } = require('electron')

module.exports = function (title, opts, onClick) {
if (window) return sendNotification(title, opts, onClick)
module.exports = function (title, opts, onClick, onClose) {
if (window) return sendNotification(title, opts, onClick, onClose)

@@ -17,14 +17,20 @@ window = new BrowserWindow({

window.on('ready-to-show', () => {
sendNotification(title, opts, onClick)
sendNotification(title, opts, onClick, onClose)
})
ipcMain.on('display-notification-onclick', (event, uid) => {
if (!callbacks[uid]) return
callbacks[uid].call(this)
if (!callbacks[uid].onClick) return
callbacks[uid].onClick.call(this)
})
ipcMain.on('display-notification-onclose', (event, uid) => {
if (!callbacks[uid].onClose) return
callbacks[uid].onClose.call(this)
})
}
function sendNotification (title, opts, onClick) {
function sendNotification (title, opts, onClick, onClose) {
var uid = uuid.v1()
if (onClick) callbacks[uid] = onClick
callbacks[uid] = {};
if (onClick) callbacks[uid].onClick = onClick
if (onClose) callbacks[uid].onClose = onClose
window.webContents.send('display-notification', {

@@ -31,0 +37,0 @@ title: title,

{
"name": "electron-main-notification",
"version": "1.0.0",
"version": "1.0.1",
"description": "Display notifications from the electron main process",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc