Team UI with max teams slots

This commit is contained in:
yflory
2019-09-24 16:55:05 +02:00
parent 09bab5fc17
commit ba6ca87792
4 changed files with 78 additions and 15 deletions

View File

@@ -16,6 +16,7 @@ define(function () {
tokenKey: 'loginToken',
displayPadCreationScreen: 'displayPadCreationScreen',
deprecatedKey: 'deprecated',
MAX_TEAMS_SLOTS: 3,
// Sub
plan: 'CryptPad_plan',
// Apps

View File

@@ -3746,8 +3746,15 @@ define([
console.log(err);
});
};
var MAX_TEAMS_SLOTS = Constants.MAX_TEAMS_SLOTS;
var todo = function (yes) {
var priv = common.getMetadataMgr().getPrivateData();
var numberOfTeams = Object.keys(priv.teams || {}).length;
if (yes) {
if (numberOfTeams >= MAX_TEAMS_SLOTS) {
return void UI.alert(Messages._getKey('team_maxTeams', [MAX_TEAMS_SLOTS]));
}
// ACCEPT
module.execCommand('JOIN_TEAM', {
team: msg.content.team