Skip to content

Commit a3c923a

Browse files
committed
hide progress bar on client detached
1 parent c8ec509 commit a3c923a

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

lib/ui.coffee

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ module.exports =
3232

3333
consumeInk: (@ink) ->
3434
@views.ink = @ink
35-
@progress.ink = @ink
3635
@selector.activate(@ink)
3736
@docpane.activate(@ink)
38-
@progress.activate()
37+
@progress.activate(@ink)
3938
@focusutils.activate(@ink)
4039
@subs.add(new Disposable(=>
4140
@docpane.deactivate()

lib/ui/progress.coffee

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,18 @@
55
module.exports =
66
progs: {}
77

8-
activate: ->
8+
activate: (ink) ->
99
@subs = new CompositeDisposable
10+
@ink = ink
1011
client.handle 'progress': (t, id, m) => @[t] id, m
1112
status = []
12-
@subs.add client.onWorking =>
13-
status = @ink?.progress.add(null, description: 'Julia')
14-
@subs.add client.onDone => status?.destroy()
15-
@subs.add client.onDetached => @clear()
13+
@subs.add(
14+
client.onWorking =>
15+
status = @ink.progress.add(null, description: 'Julia')
16+
client.onDone => status?.destroy()
17+
client.onAttached => @ink.progress.show()
18+
client.onDetached => @clear()
19+
)
1620

1721
deactivate: ->
1822
@clear()
@@ -55,3 +59,4 @@ module.exports =
5559
for _, p of @progs
5660
p?.destroy()
5761
@progs = {}
62+
@ink.progress.hide()

0 commit comments

Comments
 (0)