peer-term 1.4.9 → 1.4.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/viewer.js +7 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peer-term",
3
- "version": "1.4.9",
3
+ "version": "1.4.10",
4
4
  "license": "MIT",
5
5
  "description": "Share your terminal instantly using a 6-digit code or QR code. Encrypted. No config.",
6
6
  "repository": {
package/src/viewer.js CHANGED
@@ -107,13 +107,6 @@ export class ViewerServer {
107
107
  // Install the real data handler
108
108
  let recvBuf = '';
109
109
 
110
- // Process any leftover data that arrived after the token line
111
- if (remaining.length > 0) {
112
- handleViewerData(remaining);
113
- }
114
-
115
- socket.on('data', (chunk) => handleViewerData(chunk.toString()));
116
-
117
110
  const handleViewerData = (chunk) => {
118
111
  // Control messages start with \x00{
119
112
  if (recvBuf.length > 0 || chunk.startsWith('\x00{')) {
@@ -149,6 +142,13 @@ export class ViewerServer {
149
142
  this._onKeystroke(chunk);
150
143
  };
151
144
 
145
+ // Process any leftover data that arrived after the token line
146
+ if (remaining.length > 0) {
147
+ handleViewerData(remaining);
148
+ }
149
+
150
+ socket.on('data', (chunk) => handleViewerData(chunk.toString()));
151
+
152
152
  socket.on('close', () => {
153
153
  this._socket = null;
154
154
  this._logDebug('Host viewer disconnected.');