 
     render: ->
         (Dom.div null,
-            (ChatLink peerIdForHost: @state.peerIdForHost),
+            (ChatLink peerIdForFounder: @state.peerIdForFounder),
             (ChatMessages messages: @state.messages),
             (ChatForm sendMessage: @sendMessage))
 

    displayName: "ChatLink"

    render: ->
        if not @props.peerIdForHost
            return Noop()

        (Input id: "chatLink", label: "Chat Link", readOnly: true, value: @getLink())

    getLink: ->
        "#{ BASE_URL }/#/chat/#{ @props.peerIdForHost}"

Chat = React.createClass
    displayName: "Chat"

    getInitialState: ->
        peerIdForHost: null
        messages: []

    componentWillMount: ->
        peerIdForHost = getSegments()[1]
        isHost = not peerIdForHost?

        peer = new Peer(key: PEER_KEY)


            alert error.type

        peer.on "open", (peerId) =>
            if isFounder
                peerIdForFounder = peer.id
                @setState peerIdForFounder: peerIdForFounder

                peer.on "connection", (connection) =>
                    connection.on "open", =>
