From a014157bc9e352dfd86d7f4f3f39292c7a36086b Mon Sep 17 00:00:00 2001 From: Sai Raj <39055732+sairajzero@users.noreply.github.com> Date: Mon, 10 Aug 2020 14:14:58 +0530 Subject: [PATCH] bug removed - removing send function --- app/webAppClient.html | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/app/webAppClient.html b/app/webAppClient.html index 90bc794..1f46bda 100644 --- a/app/webAppClient.html +++ b/app/webAppClient.html @@ -18,25 +18,7 @@ //Add this to the client script to request data from floWebappServer const webAppClient = { util: { - sendData(data) { - return new Promise((resolve, reject) => { - var websocket = new WebSocket("wss://" + floGlobals.webAppURL + "/ws"); - websocket.onmessage = (evt => { - if (evt.data == '$+') { - websocket.send(data); - resolve(`Data sent to webApp`); - } else if (evt.data == '$-') - reject(`webApp not available`) - else - reject(evt.data) - websocket.close(); - }) - websocket.onerror = (evt) => { - reject(`webApp server not found`) - }; - }) - }, - + requestData(request = []) { return new Promise((resolve, reject) => { var websocket = new WebSocket("wss://" + floGlobals.webAppURL + "/ws"); @@ -58,24 +40,6 @@ } }, - sendGeneralData: function (message, type, options = {}) { - return new Promise((resolve, reject) => { - var data = { - senderID: myFloID, - receiverID: options.receiverID || floGlobals.adminID, - pubKey: myPubKey, - message: message, - sign: floCrypto.signData(JSON.stringify(message), myPrivKey), - application: options.application || floGlobals.application, - type: type, - comment: options.comment || "" - } - this.util.sendData(JSON.stringify(data), data.receiverID) - .then(result => resolve(result)) - .catch(error => reject(error)) - }) - }, - requestGeneralData: function (type, vectorClock = '0') { if (typeof vectorClock !== 'string') vectorClock.toString()