Update CryptPad code to match updated dependencies

This commit is contained in:
yflory 2023-05-10 18:17:22 +02:00
parent 11676ce3e4
commit 89fce28890
3 changed files with 5 additions and 5 deletions

View file

@ -311,7 +311,7 @@ define([
assert(function (cb) {
var keys = Block.genkeys(Nacl.randomBytes(64));
var hash = Block.getBlockHash(keys);
var hash = Block.getBlockHash(keys, ApiConfig.fileHost);
var parsed = Block.parseBlockHash(hash);
cb(parsed &&

View file

@ -306,7 +306,7 @@ define([
var opt = Login.allocateBytes(bytes);
var blockUrl = Login.Block.getBlockUrl(opt.blockKeys);
var blockUrl = Login.Block.getBlockUrl(opt.blockKeys, ApiConfig.fileHost);
var blockRequest = Login.Block.serialize("{}", opt.blockKeys);
var removeRequest = Login.Block.remove(opt.blockKeys);
console.warn('Testing block URL (%s). One 404 is normal.', blockUrl);

View file

@ -2048,7 +2048,7 @@ define([
blockKeys = allocated.blockKeys;
}));
}).nThen(function (waitFor) {
var blockUrl = Block.getBlockUrl(blockKeys);
var blockUrl = Block.getBlockUrl(blockKeys, ApiConfig.fileHost);
// Check whether there is a block at that location
Util.fetch(blockUrl, waitFor(function (err, block) {
// If there is no block or the block is invalid, continue.
@ -2092,7 +2092,7 @@ define([
}
}));
}).nThen(function (waitFor) {
var blockUrl = Block.getBlockUrl(blockKeys);
var blockUrl = Block.getBlockUrl(blockKeys, ApiConfig.fileHost);
Util.fetch(blockUrl, waitFor(function (err /* block */) {
if (err) {
console.error(err);
@ -2102,7 +2102,7 @@ define([
});
}
console.log("new login block written");
var newBlockHash = Block.getBlockHash(blockKeys);
var newBlockHash = Block.getBlockHash(blockKeys, ApiConfig.fileHost);
LocalStore.setBlockHash(newBlockHash);
}));
}).nThen(function (waitFor) {