Don't add to the same window to the atom.windows array twice

This commit is contained in:
Nathan Sobo
2012-03-15 16:10:55 -06:00
parent 60056e57fb
commit 6bdba313d1
2 changed files with 26 additions and 13 deletions

View File

@@ -25,16 +25,8 @@ class App
quit: ->
$native.terminate null
windowIdCounter: 1
windowOpened: (window) ->
id = @windowIdCounter++
console.log "window opened! #{id}"
window.id = id
@windows.push window
@windows.push(window) unless _.contains(@windows, window)
windowClosed: (window) ->
console.log "windowClosed #{window.id}"
console.log "windows length before #{@windows.length}"
_.remove(@windows, window)
console.log "windows length after #{@windows.length}"