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
|
@[name] = cb
|
||||||
|
|
||||||
execute: (node, keys=@keys) ->
|
execute: (node, keys=@keys) ->
|
||||||
|
return if node.callbacksExecuted
|
||||||
|
node.callbacksExecuted = true
|
||||||
for name in keys
|
for name in keys
|
||||||
try
|
try
|
||||||
@[name]?.call node
|
@[name]?.call node
|
||||||
|
|||||||
@ -275,6 +275,8 @@ class Post
|
|||||||
@board.posts.rm @
|
@board.posts.rm @
|
||||||
|
|
||||||
addClone: (context, contractThumb) ->
|
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
|
new Post.Clone @, context, contractThumb
|
||||||
|
|
||||||
rmClone: (index) ->
|
rmClone: (index) ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user