File tree 2 files changed +10
-1
lines changed
cli-ui/apollo-server/util
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,17 @@ const builtinIcons = {
6
6
error : path . resolve ( __dirname , '../../src/assets/error.png' )
7
7
}
8
8
9
+ let notifCallback = null
10
+ exports . setNotificationCallback = cb => {
11
+ notifCallback = cb
12
+ ? ( _err , action ) => ( action === 'activate' ) && cb ( )
13
+ : null
14
+ }
15
+
9
16
exports . notify = ( { title, message, icon } ) => {
10
17
notifier . notify ( {
11
18
title,
12
19
message,
13
20
icon : builtinIcons [ icon ] || icon
14
- } )
21
+ } , notifCallback )
15
22
}
Original file line number Diff line number Diff line change 1
1
const { log, error, openBrowser } = require ( '@vue/cli-shared-utils' )
2
2
const { portfinder, server } = require ( '@vue/cli-ui/server' )
3
3
const shortid = require ( 'shortid' )
4
+ const { setNotificationCallback } = require ( '@vue/cli-ui/apollo-server/util/notification' )
4
5
5
6
function simpleCorsValidation ( allowedHost ) {
6
7
return function ( req , socket ) {
@@ -77,6 +78,7 @@ async function ui (options = {}, context = process.cwd()) {
77
78
if ( options . headless ) {
78
79
console . log ( port )
79
80
} else {
81
+ setNotificationCallback ( ( ) => openBrowser ( url ) )
80
82
openBrowser ( url )
81
83
}
82
84
} )
You can’t perform that action at this time.
0 commit comments