aboutsummaryrefslogtreecommitdiff
path: root/src/js/arching-kaos-tools.js
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-04-11 16:17:29 +0300
committerkaotisk <kaotisk@arching-kaos.org>2024-04-11 16:17:29 +0300
commitf3249e31f3f7c9b709f203d2a01a38892d771996 (patch)
tree04d178ef91011d787c3392ec0449e40937474d5c /src/js/arching-kaos-tools.js
parent54744b09809f6ce9b58bb4dfb5bf32d0249dd9b9 (diff)
downloadarching-kaos-web-ui-f3249e31f3f7c9b709f203d2a01a38892d771996.tar.gz
arching-kaos-web-ui-f3249e31f3f7c9b709f203d2a01a38892d771996.tar.bz2
arching-kaos-web-ui-f3249e31f3f7c9b709f203d2a01a38892d771996.zip
recursion setting for crawling a zblock
Diffstat (limited to 'src/js/arching-kaos-tools.js')
-rw-r--r--src/js/arching-kaos-tools.js22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/js/arching-kaos-tools.js b/src/js/arching-kaos-tools.js
index 9ad399e..af62072 100644
--- a/src/js/arching-kaos-tools.js
+++ b/src/js/arching-kaos-tools.js
@@ -68,7 +68,8 @@ function renderZblockAndProceed(json, params){
}
progressPlaceholder.max++;
progressPlaceholder.value++;
- if (recursive) seekBlock(json.block,zblockIPFSHash,group,json);
+ //if (recursive) seekBlock(json.block,zblockIPFSHash,group,json);
+ seekBlock(json.block,zblockIPFSHash,group,json,recursive);
}
function mixtapeSorting(a,b){
@@ -76,7 +77,7 @@ function mixtapeSorting(a,b){
}
function blockRenderAndProceed(json, params){
- const [group, zblockIPFSHash, blockIPFSHash, zblockObject] = params;
+ const [group, zblockIPFSHash, blockIPFSHash, zblockObject, recursive] = params;
/* Could be json object with
* - action
* - data
@@ -141,7 +142,7 @@ function blockRenderAndProceed(json, params){
resolveReferences(references);
} else {
console.log("deep in :" +group);
- seekZblock(json.previous, [group]);
+ if (recursive) seekZblock(json.previous, [group]);
}
}
@@ -190,15 +191,20 @@ function checkIfGenesis(zblockIPFSHash){
}
}
-function seekBlock(blockIPFSHash, zblockIPFSHash, group, zblockObject){
+function seekBlock(blockIPFSHash, zblockIPFSHash, group, zblockObject, recursive){
console.log(blockIPFSHash);
console.log(zblockIPFSHash);
console.log(group);
console.log(zblockObject);
+ console.log(recursive);
archingKaosLog("Seeking block "+blockIPFSHash+"...");
detailsPlace = document.querySelector('#zb-'+zblockIPFSHash);
progressPlaceholder.max++;
- archingKaosFetchJSON(getIPFSURL(blockIPFSHash), blockRenderAndProceed, [group, zblockIPFSHash, blockIPFSHash, zblockObject]);
+ archingKaosFetchJSON(
+ getIPFSURL(blockIPFSHash),
+ blockRenderAndProceed,
+ [group, zblockIPFSHash, blockIPFSHash, zblockObject, recursive]
+ );
}
function getNicknameAssossiatedWithGPG(gpgIPFSHash){
@@ -254,9 +260,9 @@ function seekZblock(zblockIPFSHash, params){
renderGroupOnDataSection(group);
renderZblockUnderGroup(zblockIPFSHash, group);
archingKaosLog("Seeking ZBLOCK " + zblockIPFSHash + "...");
- if (recursive !== true || recursive !== false){
- recursive = true;
- }
+// if (recursive !== true || recursive !== false){
+// recursive = true;
+// }
archingKaosFetchJSON(getIPFSURL(zblockIPFSHash), renderZblockAndProceed, [zblockIPFSHash, group, recursive]);
}