No onClick in windows 10 action center after time-out
See original GitHub issueI can get the notifications to fire and can be clicked which opens another window displaying a message.
issues after notification timeout and is in the action center:
-
When clicked in the notification center the notification disappears and does not open the window.
-
nothing is registered in the console.
`notifier.on("click",` function(notifierObject, options, event) {
if(options.myCustomAction) {
options.myCustomAction()
}
// Triggers if `wait: true` and user clicks notification
var request = new sql.Request();
let username = userName;
request.query("update alerts.dbo.groupmessages set isRead = 1\
where pk = '"+ recordset.recordset[i].pk + "'\
and userFK = (select pk from alerts.dbo.users where username = '"+ username + "')\
and groupFK = (select groupFK from alerts.dbo.users where username = '"+ username + "')", function (err, recordset) {
if (err) throw err
console.log(err, recordset, 'User shit');
});
function createWindow() {
// Create the browser window.
win = new BrowserWindow({
width: 400,
height: 400,
frame: false,
webPreferences: {
nodeIntegration: true
}
});
// and load the index.html of the app.
ejse.data('message', recordset.recordset[i].message);
win.loadFile('index.ejs')
}
createWindow();
});
});
});
Promise.all(promiseArr)
.then(allRes => {
console.log("all good===>>>", allRes);
})
.catch(err => console.log("somethign went wwrong", err));
}
};```
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Electron Notification lose events when going to windows 10 ...
When Windows 10 Action Center is open, notification triggers 2 events at the same time 'show' and 'close'. When Windows 10 Action Center...
Read more >Notifications and action center not working in Windows 10 latest
1. Open the Task manager. Here's a tip: Press CTRL+Shift+ESC. · 2. Click File > Run New Task. · 3. Make sure you...
Read more >Configure your Outlook add-in for event-based activation
Each time an event that your add-in handles is triggered, the add-in is reactivated and runs the associated event handler, and the timeout...
Read more >How do I trigger a POPUP with onClick Sumbit button
I have amended the script as directed by changing the type=''submit' to type='button' with the new Javascript but it is still not firing...
Read more >Notify function in Power Apps - Power Platform - Microsoft Learn
The notification will be displayed indefinitely with a Timeout of 0. ... in 10 seconds (default timeout) if the user does not dismiss...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Timeout is defined as the amount of time that node-notifier will wait for action. This means it will stop listening if the timeout is exceeded. This might be a consistency issue with a memory leak for Notification Center in macOS and be a non-issue with Windows, but I believe this is where this feature stems from. But essentially, it’s a feature not a bug. Although you can argue the feature is limiting, but as I said, IIRC it’s due to macOS and trying to patch cross-platform behavior…
The same issue persists with node-notifier and electron 16.0.7. Native Electron notifications by itself has the same issue. Managed to do it with powertoast but there’s trick.
In Windows Toast ‘launch’ parameter should be a valid protocol type. Like for example:
https://google.com
. You can create your own custom URI scheme and get launched with some parameter. Electron supports it out of the box.Standard Electron notification options has “toastXml” that you can use to fully customize notification if you’re on Windows. So you can build your own custom toast without the need of extra libraries like node-notifier or powertoast.