Prevent a post from being killed twice,
f.e. when the thread updater udpdates the post before we get an answer from the server.
This commit is contained in:
parent
98e46dd430
commit
1e34674fdf
@ -158,10 +158,12 @@ class Post
|
|||||||
kill: (file, now) ->
|
kill: (file, now) ->
|
||||||
now or= new Date()
|
now or= new Date()
|
||||||
if file
|
if file
|
||||||
|
return if @file.isDead
|
||||||
@file.isDead = true
|
@file.isDead = true
|
||||||
@file.timeOfDeath = now
|
@file.timeOfDeath = now
|
||||||
$.addClass @nodes.root, 'deleted-file'
|
$.addClass @nodes.root, 'deleted-file'
|
||||||
else
|
else
|
||||||
|
return if @isDead
|
||||||
@isDead = true
|
@isDead = true
|
||||||
@timeOfDeath = now
|
@timeOfDeath = now
|
||||||
$.addClass @nodes.root, 'deleted-post'
|
$.addClass @nodes.root, 'deleted-post'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user