Fixed ticket reload on server change.
This commit is contained in:
parent
0f8c093bec
commit
392dd59dc4
1 changed files with 10 additions and 7 deletions
|
@ -34,11 +34,15 @@ class App.TicketZoom extends App.Controller
|
|||
@bind(
|
||||
'Ticket:update'
|
||||
(data) =>
|
||||
update = =>
|
||||
|
||||
# check if current ticket has changed
|
||||
if data.id.toString() is @ticket_id.toString()
|
||||
@log 'notice', 'TRY', new Date(data.updated_at), new Date(@ticketUpdatedAtLastCall)
|
||||
if !@ticketUpdatedAtLastCall || ( new Date(data.updated_at).toString() isnt new Date(@ticketUpdatedAtLastCall).toString() )
|
||||
|
||||
# check if we already have the request queued
|
||||
#@log 'notice', 'TRY', @ticket_id, new Date(data.updated_at), new Date(@ticketUpdatedAtLastCall)
|
||||
update = =>
|
||||
@fetch( @ticket_id, false )
|
||||
if !@ticketUpdatedAtLastCall || ( new Date(data.updated_at).toString() isnt new Date(@ticketUpdatedAtLastCall).toString() )
|
||||
@delay( update, 1800, 'ticket-zoom-' + @ticket_id )
|
||||
)
|
||||
|
||||
|
@ -264,7 +268,6 @@ class App.TicketZoom extends App.Controller
|
|||
)
|
||||
|
||||
show = (ticket) =>
|
||||
console.log('SHOW', ticket.id)
|
||||
el.find('.edit').html('')
|
||||
|
||||
defaults = ticket.attributes()
|
||||
|
|
Loading…
Reference in a new issue