ensure that function signatures are correct

This commit is contained in:
ansuz
2017-08-28 11:40:31 +02:00
parent 91f6e3e543
commit c66a0c55e0
4 changed files with 16 additions and 15 deletions

View File

@@ -16,6 +16,10 @@ define([
TODO make this not blow up when disconnected or lagging...
*/
common.whenRealtimeSyncs = function (Cryptpad, realtime, cb) {
if (typeof(realtime.getAuthDoc) !== 'function') {
return void console.error('improper use of this function');
}
window.setTimeout(function () {
if (realtime.getAuthDoc() === realtime.getUserDoc()) {
return void cb();