 (defn send [msg]
   (.emit socket "netrunner" (clj->js msg)))
 
+(defn not-spectator? [game-state app-state]
+  (#{(get-in @game-state [:corp :user]) (get-in @game-state [:runner :user])} (:user @app-state)))
+
 (defn send-command
   ([command] (send-command command nil))
   ([command args]

(defn handle-card-click [{:keys [type zone counter advance-counter advancementcost advanceable
                                 root] :as card} owner]
  (let [side (:side @game-state)]
    (when (#{(get-in @game-state [:corp :user]) (get-in @game-state [:runner :user])} (:user @app-state))
      (if (= (get-in @game-state [side :prompt 0 :prompt-type]) "select")
        (send-command "select" {:card card})
        (if (and (= (:type card) "Identity") (= side (keyword (.toLowerCase (:side card)))))

               [:div
                (om/build rfg-view {:cards (:rfg opponent) :name "Removed from the game"})
                (om/build rfg-view {:cards (:rfg me) :name "Removed from the game"})
                (when (not-spectator? game-state app-state) (om/build rfg-view {:cards (:play-area me)}))
                (om/build rfg-view {:cards (:current opponent) :name "Current"})
                (om/build rfg-view {:cards (:current me) :name "Current"})]
               (when-not (= side :spectator)
