Fix errors from clones being made before callbacks are run on the original. #1235

This commit is contained in:
ccd0 2017-01-14 07:53:29 -08:00
parent 465ddc2591
commit 35f44c0941
2 changed files with 4 additions and 0 deletions

View File

@ -11,6 +11,8 @@ class Callbacks
@[name] = cb
execute: (node, keys=@keys) ->
return if node.callbacksExecuted
node.callbacksExecuted = true
for name in keys
try
@[name]?.call node

View File

@ -275,6 +275,8 @@ class Post
@board.posts.rm @
addClone: (context, contractThumb) ->
# Callbacks may not have been run yet due to anti-browser-lock delay in Main.callbackNodesDB.
Callbacks.Post.execute @
new Post.Clone @, context, contractThumb
rmClone: (index) ->