global-input-message
Advanced tools
Comparing version 1.0.12 to 1.0.13
34
index.js
@@ -67,3 +67,2 @@ import SocketIOClient from "socket.io-client"; | ||
this.socket=null; | ||
this.qrAttributes=[]; | ||
this.encryptKey="none"; | ||
@@ -117,3 +116,3 @@ } | ||
session:this.session, | ||
data:data | ||
data | ||
}; | ||
@@ -125,13 +124,22 @@ const content=JSON.stringify(message); | ||
buidQRCodeData(data){ | ||
const qr={ | ||
url:ap.baseURL, | ||
ses:this.session, | ||
enc:this.encryptKey, | ||
data | ||
}; | ||
return JSON.stringify(qr); | ||
} | ||
processBarcodeData(barcodedata,onReceiveMessage){ | ||
processQRCodeData(qrcodedata,onReceiveMessage){ | ||
if(barcodedata.url){ | ||
console.log("switching to:"+barcodedata.url); | ||
switchMessageServer(barcodedata.url); | ||
console.log("switching to:"+qrcodedata.url); | ||
switchMessageServer(qrcodedata.url); | ||
} | ||
if(barcodedata.ses){ | ||
return this.joinSession(barcodedata.ses, onReceiveMessage); | ||
if(qrcodedata.ses){ | ||
return this.joinSession(qrcodedata.ses, onReceiveMessage); | ||
} | ||
else{ | ||
console.error("session id is null:"); | ||
console.error("ses is null in qrcode data"); | ||
return false; | ||
@@ -142,11 +150,3 @@ } | ||
buildBarcodeData(data){ | ||
const qr={ | ||
url:ap.baseURL, | ||
ses:this.session, | ||
enc:this.encryptKey, | ||
data | ||
}; | ||
return JSON.stringify(qr); | ||
} | ||
} | ||
@@ -153,0 +153,0 @@ |
{ | ||
"name": "global-input-message", | ||
"version": "1.0.12", | ||
"version": "1.0.13", | ||
"description": "global input core js library", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
16302
140