Skip to content
Snippets Groups Projects
Commit 0441b83f authored by Corentin STG_CADIOU's avatar Corentin STG_CADIOU
Browse files

Fix error with compute_when_synced

parent 90c82a6a
No related branches found
No related tags found
No related merge requests found
...@@ -105,7 +105,7 @@ module.exports = ...@@ -105,7 +105,7 @@ module.exports =
# @param f {Function} Will be executed on the PeerJs-Connector context. # @param f {Function} Will be executed on the PeerJs-Connector context.
# #
whenSynced: (args)-> whenSynced: (args)->
if args.constructore is Function if args.constructor is Function
args = [args] args = [args]
if @is_synced if @is_synced
args[0].apply this, args[1..] args[0].apply this, args[1..]
...@@ -192,8 +192,10 @@ module.exports = ...@@ -192,8 +192,10 @@ module.exports =
if not @is_synced if not @is_synced
@is_synced = true @is_synced = true
if @compute_when_synced? if @compute_when_synced?
for f in @compute_when_synced for el in @compute_when_synced
f() f = el[0]
args = el[1..]
f.apply(args)
delete @compute_when_synced delete @compute_when_synced
null null
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment