FIX: do not display add/remove participants if you can’t actually do it (#7125)
This commit is contained in:
parent
cd94ac9453
commit
c90267db52
|
@ -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) {
|
||||||
|
controls.push(
|
||||||
this.attach("button", {
|
this.attach("button", {
|
||||||
action: "toggleEditing",
|
action: "toggleEditing",
|
||||||
label: "private_message_info.edit",
|
label: "private_message_info.edit",
|
||||||
className: "btn btn-default add-remove-participant-btn"
|
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", {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (controls.length) {
|
||||||
result.push(h("div.controls", controls));
|
result.push(h("div.controls", controls));
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue