From cb58c5f71722963a622e670cf8315df9761a6350 Mon Sep 17 00:00:00 2001 From: Tony Trinh Date: Fri, 13 Nov 2020 21:59:14 -0600 Subject: [PATCH] fix: prevent snoretoast shortcut, set notif title (#2720) (#6000) This prevents SnoreToast from installing a Start Menu shortcut by specifying an appID. The appID is also used to set the notification's title bar text in Windows 10. That text is now set to "Vue UI", which replaces the default value of "SnoreToast". fixes #2720 --- packages/@vue/cli-ui/apollo-server/util/notification.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/@vue/cli-ui/apollo-server/util/notification.js b/packages/@vue/cli-ui/apollo-server/util/notification.js index 3fcacfe56f..3b24f225db 100644 --- a/packages/@vue/cli-ui/apollo-server/util/notification.js +++ b/packages/@vue/cli-ui/apollo-server/util/notification.js @@ -6,8 +6,16 @@ const builtinIcons = { error: path.resolve(__dirname, '../../src/assets/error.png') } +// https://github.com/mikaelbr/node-notifier/issues/154 +// Specify appID to prevent SnoreToast shortcut installation. +// SnoreToast actually uses it as the string in the notification's +// title bar (different from title heading inside notification). +// This only has an effect in Windows. +const snoreToastOptions = notifier.Notification === notifier.WindowsToaster && { appID: 'Vue UI' } + exports.notify = ({ title, message, icon }) => { notifier.notify({ + ...snoreToastOptions, title, message, icon: builtinIcons[icon] || icon