Try to catch race condition of opening tasks twice.

This commit is contained in:
Martin Edenhofer 2015-06-19 20:35:52 +02:00
parent 1612da3f03
commit 5ace610bc9
2 changed files with 7 additions and 7 deletions

View file

@ -131,6 +131,8 @@ class App.Navigation extends App.ControllerWidgetPermanent
user: user user: user
) )
@taskbar = new App.TaskbarWidget( el: @$('.tasks') )
# renderMenu # renderMenu
@renderMenu() @renderMenu()
@ -274,8 +276,6 @@ class App.Navigation extends App.ControllerWidgetPermanent
el: @el el: @el
) )
@taskbar = new App.TaskbarWidget( el: @$('.tasks') )
getItems: (data) -> getItems: (data) ->
navbar = _.values(data.navbar) navbar = _.values(data.navbar)

View file

@ -132,6 +132,11 @@ class _taskManagerSingleton extends Spine.Module
# input validation # input validation
params.key = App.Utils.htmlAttributeCleanup(params.key) params.key = App.Utils.htmlAttributeCleanup(params.key)
# in case an init execute arrives later but is aleady executed, ignore it
if params.init && @tasksStarted[params.key]
#console.log('IGNORE LATER INIT', params)
return
# remember started task / prevent to open task twice # remember started task / prevent to open task twice
createNewTask = true createNewTask = true
if @tasksStarted[params.key] if @tasksStarted[params.key]
@ -142,11 +147,6 @@ class _taskManagerSingleton extends Spine.Module
if params.init if params.init
params.params.init = true params.params.init = true
# in case an init execute arrives later but is aleady executed, ignore it
if params.init && @workers[ params.key ]
#console.log('IGNORE LATER INIT', params)
return
# remember latest active controller # remember latest active controller
if params.show if params.show
@activeTaskHistory.push _.clone(params) @activeTaskHistory.push _.clone(params)