mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 11:53:44 +08:00
FIX: disable flagging hidden posts
This commit is contained in:
parent
5cd055fd30
commit
94f628fb4c
|
@ -109,7 +109,7 @@ registerButton("like-count", attrs => {
|
|||
});
|
||||
|
||||
registerButton("flag", attrs => {
|
||||
if (attrs.canFlag) {
|
||||
if (attrs.canFlag && !attrs.hidden) {
|
||||
return {
|
||||
action: "showFlags",
|
||||
title: "post.controls.flag",
|
||||
|
|
|
@ -389,6 +389,16 @@ widgetTest(`flagging: can't flag`, {
|
|||
}
|
||||
});
|
||||
|
||||
widgetTest(`flagging: can't flag when post is hidden`, {
|
||||
template: '{{mount-widget widget="post" args=args}}',
|
||||
beforeEach() {
|
||||
this.set("args", { canFlag: true, hidden: true });
|
||||
},
|
||||
test(assert) {
|
||||
assert.ok(this.$("button.create-flag").length === 0);
|
||||
}
|
||||
});
|
||||
|
||||
widgetTest(`read indicator`, {
|
||||
template: '{{mount-widget widget="post" args=args}}',
|
||||
beforeEach() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user