     @onDidUpdateStack =>
       span.removeChild span.firstChild
       # find the first determinate progress bar
-      global = @stack.find (p) => p.determinate
+      global = @stack.find (p) => p.progress >= 0
       # if there is none, use the first one in the stack
       global = @stack[0] unless global?
       # display an empty progress bar if the stack is empty


  emptyProgress: (id = 'empty') ->
    id: id
    determinate: true
    progress: 0

  indeterminateProgress: (id = 'indeterminate') ->
    id: id
    determinate: false

  # update logic
  hasNoDeterminateBars: ->
    @stack.filter((p) => p.determinate).length is 0

  onDidUpdateStack: (f) -> @emitter.on 'did-update-stack', f



    updateView = (prg) =>
      return unless p.id is prg.id
      if prg.progress >= 0
        prog.setAttribute 'value', prg.progress
      else
        prog.removeAttribute 'value'
