Destroy any existing pending pane item when adding a pending item

This commit is contained in:
Katrina Uychaco
2016-01-14 17:20:32 -08:00
parent 4fce3668b6
commit 44a648a9ea
2 changed files with 26 additions and 16 deletions

View File

@@ -365,6 +365,12 @@ class Pane extends Model
return if item in @items
if item.isPending?()
for existingItem, i in @items
if existingItem.isPending?()
@destroyItem(existingItem)
break
if typeof item.onDidDestroy is 'function'
@itemSubscriptions.set item, item.onDidDestroy => @removeItem(item, false)