X-Git-Url: https://jasonwoof.com/gitweb/?p=peach-cgt.git;a=blobdiff_plain;f=client.coffee;h=63fd6c6d15137fabda6b1ed9316fa49758ec76b3;hp=fbe2815a181048a3f51ca24b56d53ef83a67c77f;hb=7797a9aab5a31f89b84ebc86c5a7bc3d12ef6602;hpb=4ae9f3f4c527c3565fa7e82c114f025053927df3 diff --git a/client.coffee b/client.coffee index fbe2815..63fd6c6 100644 --- a/client.coffee +++ b/client.coffee @@ -120,11 +120,13 @@ init = -> @cards[card].view.toggleClass 'flipped', state if agent is me tell_server ['flip', agent, card, state] - state.on 'set_cards', (cards) -> + state.on 'set_cards', (agent, cards) -> # FIXME add agent arg and tell server if it's not us $('.card').remove() for card in cards instantiate_card card + if agent is me + tell_server ['set_cards', agent, cards] # timeout so browser will stop showing that we're loading timeout 1, poll_for_updates