FIX: do not display add/remove participants if you can’t actually do it (#7125)

This commit is contained in:
Joffrey JAFFEUX 2019-03-08 09:23:26 +01:00 committed by GitHub
parent cd94ac9453
commit c90267db52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 9 deletions

View File

@ -152,14 +152,17 @@ export default createWidget("private-message-map", {
}
const result = [h(`div.participants${hideNamesClass}`, participants)];
const controls = [];
const controls = [
this.attach("button", {
action: "toggleEditing",
label: "private_message_info.edit",
className: "btn btn-default add-remove-participant-btn"
})
];
if (attrs.canRemoveAllowedUsers || attrs.canRemoveSelfId) {
controls.push(
this.attach("button", {
action: "toggleEditing",
label: "private_message_info.edit",
className: "btn btn-default add-remove-participant-btn"
})
);
}
if (attrs.canInvite && this.state.isEditing) {
controls.push(
@ -171,7 +174,9 @@ export default createWidget("private-message-map", {
);
}
result.push(h("div.controls", controls));
if (controls.length) {
result.push(h("div.controls", controls));
}
return result;
},

View File

@ -357,7 +357,10 @@ aside.quote {
display: flex;
flex-wrap: wrap;
align-items: center;
margin-bottom: 0.5em;
& + .controls {
margin-top: 0.5em;
}
&.hide-names .user {
.username,