-
-
Notifications
You must be signed in to change notification settings - Fork 474
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
Fix: Windows: Prevent Notifications from Showing on Lock Screen #820 #1410
Fix: Windows: Prevent Notifications from Showing on Lock Screen #820 #1410
Conversation
Added deep linking support with zulip://, registered the protocol handler, and implemented a dialog to choose between opening the link in the app or browser.
This update ensures that notifications are not displayed when the system is locked on Windows. Using Electron's powerMonitor, the app detects when the screen is locked and blocks notifications to prevent potential leaks of sensitive information.
Hello @avijitdas126, it seems like you have referenced #820 in your pull request description, but you have not referenced them in your commit message description(s). Referencing an issue in a commit message automatically closes the corresponding issue when the commit is merged, which makes the issue tracker easier to manage. Please run An example of a correctly-formatted commit:
To learn how to write a great commit message, please refer to our guide. |
Remove some extra code and which is added on previous commit
3e8f43e
to
6ebb9be
Compare
could anyone review this? |
Windows already has a Show notifications on the lock screen setting for this. Some users might want this behavior, so why shouldn’t we should leave this up to their Windows settings instead of forcing our own opinion on them? |
We should consider that some users might not be aware that Windows allows lock screen notifications, and displaying sensitive information there could be unexpected. While respecting system settings is important, giving users the flexibility to control this behavior within our app ensures a better user experience and prevents potential privacy concerns. Many apps, especially those handling sensitive data, provide this option to avoid unintended exposure. Instead of forcing an opinion, offering an in-app setting alongside the system behavior allows users to make an informed choice. |
This has no such setting, and since this is almost certainly AI generated, I’m not interested in arguing about it with your AI. |
In app/renderer/js/notification/index.ts powerMonitor.on("lock-screen", () => {
isLocked = true;
});
powerMonitor.on("unlock-screen", () => {
isLocked = false;
}); |
This update ensures that notifications are not displayed when the system is locked on Windows. Using Electron's
powerMonitor
, the app detects when the screen is locked and blocks notifications to prevent potential leaks of sensitive information.Fixes: #820
powerMonitor
event listeners to detect lock-screen and unlock-screen events.newNotification
function to check isLocked before creating a notification.Platforms this PR was tested on:
Self-review checklist
(variable names, code reuse, readability, etc.).
Communicate decisions, questions, and potential concerns.
Individual commits are ready for review (see commit discipline).
Completed manual review and testing of the following: