Set degraded mode limit in AppConfig

pull/1/head
yflory 4 years ago
parent 3e969dd9a5
commit 9980346ef7

@ -179,5 +179,16 @@ define(function() {
// You can change the value here.
// config.maxOwnedTeams = 5;
// The userlist displayed in collaborative documents is stored alongside the document data.
// Everytime someone with edit rights joins a document or modify their user data (display
// name, avatar, color, etc.), they update the "userlist" part of the document. When too many
// editors are in the same document, all these changes increase the risks of conflicts which
// require CPU time to solve. A "degraded" mode can now be set when a certain number of editors
// are in a document at the same time. This mode disables the userlist, the chat and the
// position of other users' cursor. You can configure the number of user from which the session
// will enter into degraded mode. A big number may result in collaborative edition being broken,
// but this number depends on the network and CPU performances of each user's device.
config.degradedLimit = 8;
return config;
});

@ -2,11 +2,13 @@ define([
'/common/common-util.js',
'/common/common-constants.js',
'/customize/messages.js',
'/customize/application_config.js',
'/bower_components/chainpad-crypto/crypto.js',
], function (Util, Constants, Messages, Crypto) {
], function (Util, Constants, Messages, AppConfig, Crypto) {
var Cursor = {};
var DEGRADED = 3; // XXX Number of users before switching to degraded mode
var DEGRADED = AppConfig.degradedLimit || 8;
console.log(DEGRADED);
var convertToUint8 = function (obj) {
var l = Object.keys(obj).length;

Loading…
Cancel
Save