Improved reload trigger if somebody else changed ticket.
This commit is contained in:
parent
ac12b98c9e
commit
075aade8a8
1 changed files with 2 additions and 3 deletions
|
@ -27,9 +27,8 @@ class App.TicketZoom extends App.Controller
|
||||||
(data) =>
|
(data) =>
|
||||||
update = =>
|
update = =>
|
||||||
if data.id.toString() is @ticket_id.toString()
|
if data.id.toString() is @ticket_id.toString()
|
||||||
ticket = App.Ticket.find( @ticket_id )
|
@log 'notice', 'TRY', new Date(data.updated_at), new Date(@ticketUpdatedAtLastCall)
|
||||||
@log 'notice', 'TRY', Date(data.updated_at), Date(ticket.updated_at)
|
if !@ticketUpdatedAtLastCall || ( new Date(data.updated_at).toString() isnt new Date(@ticketUpdatedAtLastCall).toString() )
|
||||||
if Date(data.updated_at) isnt Date(ticket.updated_at)
|
|
||||||
@fetch( @ticket_id, false )
|
@fetch( @ticket_id, false )
|
||||||
@delay( update, 1800, 'ticket-zoom-' + @ticket_id )
|
@delay( update, 1800, 'ticket-zoom-' + @ticket_id )
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue