mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-12 19:49:59 +05:00
Fix loading issues
This commit is contained in:
parent
4b1597a65b
commit
dc41e9c1a8
8
package-lock.json
generated
8
package-lock.json
generated
@ -18,7 +18,7 @@
|
||||
"chainpad": "^5.2.6",
|
||||
"chainpad-crypto": "^0.2.5",
|
||||
"chainpad-listmap": "^1.1.1",
|
||||
"chainpad-netflux": "^1.2.2",
|
||||
"chainpad-netflux": "^1.2.3",
|
||||
"chainpad-server": "^5.2.4",
|
||||
"ckeditor": "npm:ckeditor4@~4.22.1",
|
||||
"codemirror": "^5.19.0",
|
||||
@ -1927,9 +1927,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/chainpad-netflux": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/chainpad-netflux/-/chainpad-netflux-1.2.2.tgz",
|
||||
"integrity": "sha512-fcKugW29BE4wo4l3WYLc56yeFznu15bGi6tU3uPtsLGSExXGqNwS+3kmpzI0AFAsuoI0OKPeT4uLX4YzKT/D+A==",
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/chainpad-netflux/-/chainpad-netflux-1.2.3.tgz",
|
||||
"integrity": "sha512-bXLUSxAsCu4kRnGorW+7fVofiCWSNGRkB+uFJ4kUV/zDJ3RJYU4J3+DZsL4rCTkLkAjgKt+YQCoYciCKLlTwqg==",
|
||||
"license": "LGPL-2.1",
|
||||
"dependencies": {
|
||||
"netflux-websocket": "^1.2.0"
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
"chainpad": "^5.2.6",
|
||||
"chainpad-crypto": "^0.2.5",
|
||||
"chainpad-listmap": "^1.1.1",
|
||||
"chainpad-netflux": "^1.2.2",
|
||||
"chainpad-netflux": "^1.2.3",
|
||||
"chainpad-server": "^5.2.4",
|
||||
"ckeditor": "npm:ckeditor4@~4.22.1",
|
||||
"codemirror": "^5.19.0",
|
||||
|
||||
@ -2866,8 +2866,11 @@ const factory = (ApiConfig = {}, Sortify, UserObject, ProxyManager,
|
||||
loadSyncModules(waitFor);
|
||||
loadUniversal(Profile, 'profile', waitFor);
|
||||
loadUniversal(Calendar, 'calendar', waitFor);
|
||||
if (store.modules['team']) { store.modules['team'].onReady(waitFor); }
|
||||
loadUniversal(Support, 'support', waitFor);
|
||||
nThen(waitFor => {
|
||||
// Make teams non-blocking
|
||||
if (store.modules['team']) { store.modules['team'].onReady(waitFor); }
|
||||
});
|
||||
}).nThen(function () {
|
||||
var requestLogin = function () {
|
||||
broadcast([], "REQUEST_LOGIN");
|
||||
@ -3280,22 +3283,36 @@ const factory = (ApiConfig = {}, Sortify, UserObject, ProxyManager,
|
||||
}
|
||||
|
||||
if (requires === 'team') {
|
||||
const initTeams = Util.once(ret => {
|
||||
// On cache ready (if cache enabled)
|
||||
// or on ready (if cache disabled)
|
||||
nThen(w => {
|
||||
loadUniversal(Team, 'team', w, clientId);
|
||||
}).nThen(() => {
|
||||
cb(ret);
|
||||
loadDrive(clientId, data, ret => {
|
||||
startCacheModules(clientId, ret, onInit);
|
||||
}, ret => {
|
||||
startModules(clientId, ret, onInit);
|
||||
let called = false;
|
||||
const initTeams = cache => {
|
||||
return ret => {
|
||||
if (called) { return; }
|
||||
called = true;
|
||||
// On cache ready (if cache enabled)
|
||||
// or on ready (if cache disabled)
|
||||
nThen(w => {
|
||||
if (cache) { return; }
|
||||
initAnonRpc(null, null, w());
|
||||
}).nThen(w => {
|
||||
loadUniversal(Team, 'team', w, clientId);
|
||||
}).nThen(w => {
|
||||
// Sync teams before other modules
|
||||
// when cache is empty
|
||||
if (!cache && store.modules['team']) {
|
||||
store.modules['team'].onReady(w);
|
||||
}
|
||||
}).nThen(() => {
|
||||
cb(ret);
|
||||
loadDrive(clientId, data, ret => {
|
||||
startCacheModules(clientId, ret, onInit);
|
||||
}, ret => {
|
||||
startModules(clientId, ret, onInit);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
};
|
||||
return void loadAccount(clientId, data,
|
||||
initTeams, initTeams);
|
||||
initTeams(true), initTeams(false));
|
||||
}
|
||||
|
||||
if (requires === 'drive') {
|
||||
|
||||
@ -641,11 +641,17 @@ var factory = function (Util, Hash, CPNetflux, Sortify, nThen, Crypto, Feedback)
|
||||
return Boolean(ready && me);
|
||||
};
|
||||
|
||||
var lastHash;
|
||||
var onMessage = function (msg, user, vKey, isCp , hash, author) {
|
||||
// count messages received since the last checkpoint
|
||||
// even if they fail to parse
|
||||
ref.internal.sinceLastCheckpoint++;
|
||||
|
||||
if (lastHash !== hash) {
|
||||
// Don't count duplicate lkh message on reconnect
|
||||
ref.internal.sinceLastCheckpoint++;
|
||||
}
|
||||
|
||||
lastHash = hash;
|
||||
var parsed = Util.tryParse(msg);
|
||||
|
||||
if (!parsed) { return void console.error("could not parse"); }
|
||||
|
||||
@ -641,11 +641,17 @@ var factory = function (Util, Hash, CPNetflux, Sortify, nThen, Crypto, Feedback)
|
||||
return Boolean(ready && me);
|
||||
};
|
||||
|
||||
var lastHash;
|
||||
var onMessage = function (msg, user, vKey, isCp , hash, author) {
|
||||
// count messages received since the last checkpoint
|
||||
// even if they fail to parse
|
||||
ref.internal.sinceLastCheckpoint++;
|
||||
|
||||
if (lastHash !== hash) {
|
||||
// Don't count duplicate lkh message on reconnect
|
||||
ref.internal.sinceLastCheckpoint++;
|
||||
}
|
||||
|
||||
lastHash = hash;
|
||||
var parsed = Util.tryParse(msg);
|
||||
|
||||
if (!parsed) { return void console.error("could not parse"); }
|
||||
|
||||
2
www/common/worker.bundle.min.js
vendored
2
www/common/worker.bundle.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user