Fix errors from clones being made before callbacks are run on the original. #1235
This commit is contained in:
parent
465ddc2591
commit
35f44c0941
@ -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
|
||||
|
||||
@ -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) ->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user