Skip to content

Commit 67df48a

Browse files
committed
Fix busy messages lingering sometimes
Fixes #372
1 parent 0679592 commit 67df48a

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## 3.2.1
22
* Update to core [3.2.1](https://gitlab.com/php-integrator/core/tags/3.2.1)
3+
* [Fix busy messages lingering sometimes](https://github.com/php-integrator/atom-base/issues/372)
34
* [Fix indexing busy messages not showing what is actually being indexed](https://github.com/php-integrator/atom-base/issues/372)
45

56
## 3.2.0

lib/Main.coffee

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -468,24 +468,31 @@ module.exports =
468468
return 'Indexing ' + path
469469

470470
service.onDidStartIndexing ({path}) =>
471-
indexBusyMessageMap[path] = @busySignalService.reportBusy(getBaseMessageForPath(path), {
471+
if not indexBusyMessageMap.has(path)
472+
indexBusyMessageMap.set(path, new Array())
473+
474+
indexBusyMessageMap.get(path).push(@busySignalService.reportBusy(getBaseMessageForPath(path), {
472475
waitingFor : 'computer',
473476
revealTooltip : true
474-
})
477+
}))
475478

476479
service.onDidFinishIndexing ({path}) =>
477-
if path of indexBusyMessageMap
478-
indexBusyMessageMap[path].dispose()
479-
delete indexBusyMessageMap[path]
480+
return if not indexBusyMessageMap.has(path)
481+
482+
indexBusyMessageMap.get(path).forEach((busyMessage) => busyMessage.dispose())
483+
indexBusyMessageMap.delete(path)
480484

481485
service.onDidFailIndexing ({path}) =>
482-
if path of indexBusyMessageMap
483-
indexBusyMessageMap[path].dispose()
484-
delete indexBusyMessageMap[path]
486+
return if not indexBusyMessageMap.has(path)
487+
488+
indexBusyMessageMap.get(path).forEach((busyMessage) => busyMessage.dispose())
489+
indexBusyMessageMap.delete(path)
485490

486491
service.onDidIndexingProgress ({path, percentage}) =>
487-
if indexBusyMessageMap[path]?
488-
indexBusyMessageMap[path].setTitle(getBaseMessageForPath(path) + " (" + percentage.toFixed(2) + " %)")
492+
return if not indexBusyMessageMap.has(path)
493+
494+
indexBusyMessageMap.get(path).forEach (busyMessage) =>
495+
busyMessage.setTitle(getBaseMessageForPath(path) + " (" + percentage.toFixed(2) + " %)")
489496

490497
###*
491498
* @return {Promise}

0 commit comments

Comments
 (0)