                     @connections.push connection
                     @listenForMessage connection
 
-                    peerIds = @connectionsToPeerIds @connections
-
                     connection.on "open", =>
+                        @showAlertAboutNewConnection()
+
                         connectionsWithoutNewConnection = _.filter @connections, (c) -> c.peer != connection.peer
                         peerIdsWithoutNewConnection = @connectionsToPeerIds connectionsWithoutNewConnection
 

                messages = @state.messages
                messages.push data.message
                @setState messages: messages

Settings = React.createClass
    mixins: [React.addons.LinkedStateMixin]


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

                        @connections.push connection
                        @listenForMessage connection

