Skip to content

Commit

Permalink
Remove the callback parameter of removeTab()
Browse files Browse the repository at this point in the history
callback parameter is never passed to removeTab(), so adding it to
the selectionChangeHandlers list causes 'Can not call method call() of undefined'
error after closing the tab.
  • Loading branch information
sainaen committed May 9, 2013
1 parent c7180d1 commit e678622
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions background_scripts/main.coffee
Expand Up @@ -234,12 +234,9 @@ BackgroundCommands =
previousTab: (callback) -> selectTab(callback, "previous")
firstTab: (callback) -> selectTab(callback, "first")
lastTab: (callback) -> selectTab(callback, "last")
removeTab: (callback) ->
removeTab: ->
chrome.tabs.getSelected(null, (tab) ->
chrome.tabs.remove(tab.id)
# We can't just call the callback here because we need to wait
# for the selection to change to consider this action done.
selectionChangedHandlers.push(callback))
chrome.tabs.remove(tab.id))
restoreTab: (callback) ->
# TODO(ilya): Should this be getLastFocused instead?
chrome.windows.getCurrent((window) ->
Expand Down

0 comments on commit e678622

Please sign in to comment.