File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
plugins/plugin-codeflare/src/tray Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ export default async function submenuForRuns(
4949 // infinite loop
5050 await watchers [ profile ] . init ( )
5151
52- const { runs } = watchers [ profile ]
52+ const runs = watchers [ profile ] . runs
5353 return runs . length && runs [ 0 ] !== RUNS_ERROR
5454 ? runMenuItems ( profile , open , runs )
5555 : [ { label : RUNS_ERROR , enabled : false } ]
Original file line number Diff line number Diff line change @@ -31,13 +31,13 @@ export default class ProfileWatcher {
3131 public constructor (
3232 private readonly updateFn : UpdateFunction ,
3333 private readonly profilesPath : string ,
34- private readonly watcher = chokidar . watch ( profilesPath )
34+ private readonly watcher = chokidar . watch ( profilesPath , { depth : 0 } )
3535 ) { }
3636
3737 /** Initialize `this._profiles` model */
3838 public async init ( ) : Promise < ProfileWatcher > {
3939 if ( ! this . _initDone ) {
40- await this . readOnce ( )
40+ // await this.readOnce() no need, since chokidar gives us an initial read
4141 this . initWatcher ( )
4242 this . _initDone = true
4343 }
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ export default class ProfileRunWatcher {
3939 public constructor (
4040 private readonly updateFn : UpdateFunction ,
4141 private readonly profile : string ,
42- private readonly watcher = chokidar . watch ( ProfileRunWatcher . path ( profile ) )
42+ private readonly watcher = chokidar . watch ( ProfileRunWatcher . path ( profile ) + "/*" , { depth : 0 } )
4343 ) { }
4444
4545 private static path ( profile : string ) {
@@ -49,7 +49,7 @@ export default class ProfileRunWatcher {
4949 /** Initialize `this._runs` model */
5050 public async init ( ) : Promise < ProfileRunWatcher > {
5151 if ( ! this . _initDone ) {
52- await this . readOnce ( )
52+ // await this.readOnce() no need, since chokidar gives us an initial read
5353 this . initWatcher ( )
5454 this . _initDone = true
5555 }
@@ -58,7 +58,7 @@ export default class ProfileRunWatcher {
5858
5959 /** Initialize the filesystem watcher to notify us of new or removed profiles */
6060 private initWatcher ( ) {
61- this . watcher . on ( "add " , async ( path ) => {
61+ this . watcher . on ( "addDir " , async ( path ) => {
6262 const runId = basename ( path )
6363 const idx = this . runs . findIndex ( ( _ ) => _ === runId )
6464 if ( idx < 0 ) {
You can’t perform that action at this time.
0 commit comments