Bug fixes

- Renamed standard_Operations.html to index.html
- Fixed some minor bugs in floCloudAPI
- Added: floCrypto.validateFloID (alias for floCrypto.validateAddr)
This commit is contained in:
sairajzero 2022-03-31 21:54:51 +05:30
parent 3d4aee6359
commit f27c8c4f03
3 changed files with 10 additions and 9 deletions

View File

@ -1,9 +1,9 @@
(function(EXPORTS) { //floCloudAPI v2.2.0 (function(EXPORTS) { //floCloudAPI v2.2.0a
/* FLO Cloud operations to send/request application data*/ /* FLO Cloud operations to send/request application data*/
'use strict'; 'use strict';
const floCloudAPI = EXPORTS; const floCloudAPI = EXPORTS;
var Kbucket; var kBucket;
const K_Bucket = floCloudAPI.K_Bucket = function(masterID, nodeList) { const K_Bucket = floCloudAPI.K_Bucket = function(masterID, nodeList) {
const decodeID = floID => { const decodeID = floID => {
@ -102,7 +102,7 @@
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
try { try {
nodeList = nodeList || Object.keys(floGlobals.supernodes); nodeList = nodeList || Object.keys(floGlobals.supernodes);
Kbucket = new K_Bucket(SNStorageID, nodeList); kBucket = new K_Bucket(SNStorageID, nodeList);
resolve('Cloud init successful'); resolve('Cloud init successful');
} catch (error) { } catch (error) {
reject(error); reject(error);
@ -110,8 +110,8 @@
}) })
} }
Object.defineProperty(floCloudAPI, 'Kbucket', { Object.defineProperty(floCloudAPI, 'kBucket', {
get: () => Kbucket get: () => kBucket
}); });
const _inactive = new Set(); const _inactive = new Set();
@ -252,7 +252,8 @@
let randID = floCrypto.randString(5); let randID = floCrypto.randString(5);
node.send(JSON.stringify(request)); node.send(JSON.stringify(request));
node.onmessage = (evt) => { node.onmessage = (evt) => {
let d = e = null; let d = null,
e = null;
try { try {
d = filterData(JSON.parse(evt.data)); d = filterData(JSON.parse(evt.data));
} catch (error) { } catch (error) {
@ -314,7 +315,7 @@
break; break;
case "UPDATE": case "UPDATE":
if (dataSet[vc].message.diff) if (dataSet[vc].message.diff)
floGlobals.appObjects[objectName] = mergeDiff(floGlobals.appObjects[objectName], dataSet[vc].message.diff); floGlobals.appObjects[objectName] = diff.merge(floGlobals.appObjects[objectName], dataSet[vc].message.diff);
} }
floGlobals.lastVC[objectName] = vc; floGlobals.lastVC[objectName] = vc;
} }

View File

@ -1,4 +1,4 @@
(function(EXPORTS) { //floCrypto v2.3.0 (function(EXPORTS) { //floCrypto v2.3.0a
/* FLO Crypto Operators */ /* FLO Crypto Operators */
'use strict'; 'use strict';
const floCrypto = EXPORTS; const floCrypto = EXPORTS;
@ -203,7 +203,7 @@
} }
//Check if the given Address is valid or not //Check if the given Address is valid or not
floCrypto.validateAddr = function(inpAddr) { floCrypto.validateFloID = floCrypto.validateAddr = function(inpAddr) {
if (!inpAddr) if (!inpAddr)
return false; return false;
try { try {