Michelle Bu 12 rokov pred
rodič
commit
d4f9b9f46a
4 zmenil súbory, kde vykonal 5 pridanie a 5 odobranie
  1. 2 2
      demo/static/peer.js
  2. 2 2
      dist/peer.js
  3. 0 0
      dist/peer.min.js
  4. 1 1
      lib/socket.js

+ 2 - 2
demo/static/peer.js

@@ -911,8 +911,8 @@ Peer.prototype._handleServerJSONMessage = function(message) {
       if (!this.id) {
       if (!this.id) {
         // If we're just now getting an ID then we may have a queue.
         // If we're just now getting an ID then we may have a queue.
         this.id = message.id;
         this.id = message.id;
+        this.emit('id', this.id);
       }
       }
-      this.emit('open', this.id);
       this._processQueue();
       this._processQueue();
       break;
       break;
     case 'ERROR':
     case 'ERROR':
@@ -1395,7 +1395,7 @@ Socket.prototype._checkIn = function() {
             if (!!response.id) {
             if (!!response.id) {
               self._id = response.id;
               self._id = response.id;
               self._startWebSocket();
               self._startWebSocket();
-              self.emit('message', { type: 'ID', id: self._id });
+              self.emit('message', { type: 'OPEN', id: self._id });
             }
             }
           } catch (e) {
           } catch (e) {
             self._startWebSocket();
             self._startWebSocket();

+ 2 - 2
dist/peer.js

@@ -911,8 +911,8 @@ Peer.prototype._handleServerJSONMessage = function(message) {
       if (!this.id) {
       if (!this.id) {
         // If we're just now getting an ID then we may have a queue.
         // If we're just now getting an ID then we may have a queue.
         this.id = message.id;
         this.id = message.id;
+        this.emit('id', this.id);
       }
       }
-      this.emit('open', this.id);
       this._processQueue();
       this._processQueue();
       break;
       break;
     case 'ERROR':
     case 'ERROR':
@@ -1395,7 +1395,7 @@ Socket.prototype._checkIn = function() {
             if (!!response.id) {
             if (!!response.id) {
               self._id = response.id;
               self._id = response.id;
               self._startWebSocket();
               self._startWebSocket();
-              self.emit('message', { type: 'ID', id: self._id });
+              self.emit('message', { type: 'OPEN', id: self._id });
             }
             }
           } catch (e) {
           } catch (e) {
             self._startWebSocket();
             self._startWebSocket();

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
dist/peer.min.js


+ 1 - 1
lib/socket.js

@@ -37,7 +37,7 @@ Socket.prototype._checkIn = function() {
             if (!!response.id) {
             if (!!response.id) {
               self._id = response.id;
               self._id = response.id;
               self._startWebSocket();
               self._startWebSocket();
-              self.emit('message', { type: 'ID', id: self._id });
+              self.emit('message', { type: 'OPEN', id: self._id });
             }
             }
           } catch (e) {
           } catch (e) {
             self._startWebSocket();
             self._startWebSocket();

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov