Skip to content

Commit

Permalink
UX: don't show the whisper toggle when replying to a whisper
Browse files Browse the repository at this point in the history
  • Loading branch information
ZogStriP committed Aug 21, 2018
1 parent 17dc8f2 commit 61447a8
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions app/assets/javascripts/discourse/controllers/composer.js.es6
Expand Up @@ -203,15 +203,21 @@ export default Ember.Controller.extend({

canUnlistTopic: Em.computed.and("model.creatingTopic", "isStaffUser"),

@computed("model.action", "isStaffUser")
canWhisper(action, isStaffUser) {
@computed("canWhisper", "model.whisper")
showWhisperToggle(canWhisper, isWhisper) {
return canWhisper && !isWhisper;
},

@computed("isStaffUser", "model.action")
canWhisper(isStaffUser, action) {
return (
isStaffUser &&
this.siteSettings.enable_whispers &&
action === Composer.REPLY
isStaffUser &&
Composer.REPLY === action
);
},


_setupPopupMenuOption(callback) {
let option = callback();

Expand Down Expand Up @@ -246,7 +252,7 @@ export default Ember.Controller.extend({
action: "toggleWhisper",
icon: "eye-slash",
label: "composer.toggle_whisper",
condition: "canWhisper"
condition: "showWhisperToggle"
};
})
);
Expand Down

1 comment on commit 61447a8

@discoursebot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/replying-to-a-whisper-should-not-show-the-whisper-toggle/92464/8

Please sign in to comment.