You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My application is developed in electron with react.
Here I'm trying to show a notification to the user to make the choice of taking a webcam snap or not. And it's working fine when I'd implemented it. But now it's not working and it hangs the whole application and also it's not quit form tray. We've to kill the process of application from the task manager only.
When I've put code of notification on electron means in the main process then events of notifier like a timeout OR on action click we get a response of it. And we can do the process further based on that notification response.
Now I've tried to put the code of the main process to renderer process means in react part then the application does not hang when we click on the notification action(custom button). But in that not working events of timeout OR action(custom button) event. Here is the code for showing a notification and taking a response from the user.
//code of show notification
const notifyOpt = {
title: 'Shoot',
message: 'Your webcam screenshot will be taken.',
actions: ["Click here to Deny"],
sound: true,
timeout: 15,
wait: true,
};
notifier.notify(notifyOpt);
notifier.on('timeout', () => {
console.log("YES TIMEOUT");
return resolve('YES');
});
notifier.on('click here to deny', () => {
console.log("NO DENY");
return resolve('NO');
});
So If anyone knows the solution just give me as soon as possible. It's urgent. Thanks in advance.
Thanks,
Bharat.
The text was updated successfully, but these errors were encountered:
bharat303
changed the title
When we put action on notification and click on that.
When we put action(custom button) on notification and click on that application gets hang.
Dec 6, 2021
My application is developed in electron with react.
Here I'm trying to show a notification to the user to make the choice of taking a webcam snap or not. And it's working fine when I'd implemented it. But now it's not working and it hangs the whole application and also it's not quit form tray. We've to kill the process of application from the task manager only.
When I've put code of notification on electron means in the main process then events of notifier like a timeout OR on action click we get a response of it. And we can do the process further based on that notification response.
Now I've tried to put the code of the main process to renderer process means in react part then the application does not hang when we click on the notification action(custom button). But in that not working events of timeout OR action(custom button) event. Here is the code for showing a notification and taking a response from the user.
//code of show notification
const notifyOpt = {
title: 'Shoot',
message: 'Your webcam screenshot will be taken.',
actions: ["Click here to Deny"],
sound: true,
timeout: 15,
wait: true,
};
notifier.notify(notifyOpt);
notifier.on('timeout', () => {
console.log("YES TIMEOUT");
return resolve('YES');
});
notifier.on('click here to deny', () => {
console.log("NO DENY");
return resolve('NO');
});
So If anyone knows the solution just give me as soon as possible. It's urgent. Thanks in advance.
Thanks,
Bharat.
The text was updated successfully, but these errors were encountered: