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 result = [h(`div.participants${hideNamesClass}`, participants)];
const controls = [];
const controls = [ if (attrs.canRemoveAllowedUsers || attrs.canRemoveSelfId) {
this.attach("button", { controls.push(
action: "toggleEditing", this.attach("button", {
label: "private_message_info.edit", action: "toggleEditing",
className: "btn btn-default add-remove-participant-btn" label: "private_message_info.edit",
}) className: "btn btn-default add-remove-participant-btn"
]; })
);
}
if (attrs.canInvite && this.state.isEditing) { if (attrs.canInvite && this.state.isEditing) {
controls.push( 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; return result;
}, },

View File

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