From 7b4a72b3a224b493e8eb3fdec929c89a3f5a28dc Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 30 Sep 2019 15:20:44 +0200 Subject: [PATCH] lint compliance --- www/common/outer/team.js | 9 ++++----- www/teams/inner.js | 12 +++++++----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/www/common/outer/team.js b/www/common/outer/team.js index 5512b782b..1c3c29a70 100644 --- a/www/common/outer/team.js +++ b/www/common/outer/team.js @@ -301,7 +301,7 @@ define([ userName: 'team', classic: true }; - cfg.onMetadataUpdate = function (md) { + cfg.onMetadataUpdate = function () { var team = ctx.teams[id]; if (!team) { return; } ctx.emit('ROSTER_CHANGE', id, team.clients); @@ -456,7 +456,8 @@ define([ })); }).nThen(function () { var id = Util.createRandomInteger(); - config.onMetadataUpdate = function (md) { + config.onMetadataUpdate = function () { + var team = ctx.teams[id]; if (!team) { return; } ctx.emit('ROSTER_CHANGE', id, team.clients); }; @@ -852,12 +853,10 @@ define([ var user = state.members[data.curvePublic]; // It it is an ownership revocation, we have to set it in pad metadata first - console.log(user.role, data.data.role); if (user.role === "OWNER" && data.data.role !== "OWNER") { revokeOwnership(ctx, teamId, user, function (err) { - console.error(err); if (!err) { return; } - waitFor.abort(); + console.error(err); return void cb({error: err}); }); return; diff --git a/www/teams/inner.js b/www/teams/inner.js index bb01e5e11..8f858a751 100644 --- a/www/teams/inner.js +++ b/www/teams/inner.js @@ -443,12 +443,13 @@ define([ var theirRole = ROLES.indexOf(data.role) || 0; // If they're an admin and I am an owner, I can promote them to owner if (!isMe && myRole > theirRole && theirRole === 1 && !data.pending) { - var promote = h('span.fa.fa-angle-double-up', { + var promoteOwner = h('span.fa.fa-angle-double-up', { title: "Offer ownership" // XXX }); - $(promote).click(function () { - $(promote).hide(); + $(promoteOwner).click(function () { + $(promoteOwner).hide(); UI.confirm("Are you sure???", function (yes) { // XXX + if (!yes) { return; } APP.module.execCommand('OFFER_OWNERSHIP', { teamId: APP.team, curvePublic: data.curvePublic @@ -461,7 +462,7 @@ define([ }); }); }); - $actions.append(promote); + $actions.append(promoteOwner); } // If they're a member and I have a higher role than them, I can promote them to admin if (!isMe && myRole > theirRole && theirRole === 0 && !data.pending) { @@ -754,6 +755,7 @@ define([ $(deleteTeam).click(function () { if (deleting) { return; } UI.confirm("Are you sure", function (yes) { // XXX + if (!yes) { return; } if (deleting) { return; } deleting = true; $spinner.show(); @@ -761,7 +763,7 @@ define([ teamId: APP.team }, function (obj) { $spinner.hide(); - deleting = false + deleting = false; if (obj && obj.error) { return void UI.warn(obj.error); }