Team UI with max teams slots
This commit is contained in:
@@ -16,6 +16,7 @@ define(function () {
|
||||
tokenKey: 'loginToken',
|
||||
displayPadCreationScreen: 'displayPadCreationScreen',
|
||||
deprecatedKey: 'deprecated',
|
||||
MAX_TEAMS_SLOTS: 3,
|
||||
// Sub
|
||||
plan: 'CryptPad_plan',
|
||||
// Apps
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user