Skip to content

Commit

Permalink
fix: prevent snoretoast shortcut, set notif title (#2720) (#6000)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tony19 authored and sodatea committed Jan 6, 2021
1 parent ed2cf22 commit 4f69a43
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/@vue/cli-ui/apollo-server/util/notification.js
Expand Up @@ -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
Expand Down

0 comments on commit 4f69a43

Please sign in to comment.