Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging

pull/1/head
yflory 7 years ago
commit a927f40f02

@ -129,6 +129,10 @@ define([
return messenger.range_requests[txid]; return messenger.range_requests[txid];
}; };
var deleteRangeRequest = function (txid) {
delete messenger.range_requests[txid];
};
messenger.getMoreHistory = function (curvePublic, hash, count, cb) { messenger.getMoreHistory = function (curvePublic, hash, count, cb) {
if (typeof(cb) !== 'function') { return; } if (typeof(cb) !== 'function') { return; }
@ -393,7 +397,8 @@ define([
}); });
orderMessages(curvePublic, decrypted, req.sig); orderMessages(curvePublic, decrypted, req.sig);
return void req.cb(void 0, decrypted); req.cb(void 0, decrypted);
return deleteRangeRequest(txid);
} else { } else {
console.log(parsed); console.log(parsed);
} }

@ -6,19 +6,21 @@ define([
'/common/common-messenger.js', '/common/common-messenger.js',
'/contacts/messenger-ui.js', '/contacts/messenger-ui.js',
'/bower_components/nthen/index.js',
'less!/bower_components/components-font-awesome/css/font-awesome.min.css', 'less!/bower_components/components-font-awesome/css/font-awesome.min.css',
'less!/customize/src/less/cryptpad.less', 'less!/customize/src/less/cryptpad.less',
], function ($, Crypto, Toolbar, Cryptpad, Messenger, UI) { ], function ($, Crypto, Toolbar, Cryptpad, Messenger, UI, Nthen) {
var Messages = Cryptpad.Messages; var Messages = Cryptpad.Messages;
var APP = window.APP = { var APP = window.APP = {
Cryptpad: Cryptpad Cryptpad: Cryptpad
}; };
$(function () { Nthen(function (waitFor) {
$(waitFor());
var andThen = function () { }).nThen(function (waitFor) {
Cryptpad.ready(waitFor(Cryptpad.reportAppUsage));
}).nThen(function () {
Cryptpad.addLoadingScreen(); Cryptpad.addLoadingScreen();
var ifrw = $('#pad-iframe')[0].contentWindow; var ifrw = $('#pad-iframe')[0].contentWindow;
@ -56,12 +58,5 @@ define([
var messenger = window.messenger = Messenger.messenger(Cryptpad); var messenger = window.messenger = Messenger.messenger(Cryptpad);
UI.create(messenger, $list, $messages); UI.create(messenger, $list, $messages);
};
Cryptpad.ready(function () {
andThen();
Cryptpad.reportAppUsage();
});
}); });
}); });

@ -129,7 +129,7 @@ define([
console.error('No more messages to fetch'); console.error('No more messages to fetch');
channel.exhausted = true; channel.exhausted = true;
console.log(channel); console.log(channel);
return; return void $moreHistory.addClass('faded');
} else { } else {
channel.TAIL = msg.sig; channel.TAIL = msg.sig;
} }

Loading…
Cancel
Save