Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When we put action(custom button) on notification and click on that application gets hang. #385

Open
bharat303 opened this issue Dec 6, 2021 · 0 comments

Comments

@bharat303
Copy link

bharat303 commented 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.

@bharat303 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant