mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 02:32:45 +08:00
UX: don't show the whisper toggle when replying to a whisper
This commit is contained in:
parent
17dc8f2490
commit
61447a8046
|
@ -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();
|
||||
|
||||
|
@ -246,7 +252,7 @@ export default Ember.Controller.extend({
|
|||
action: "toggleWhisper",
|
||||
icon: "eye-slash",
|
||||
label: "composer.toggle_whisper",
|
||||
condition: "canWhisper"
|
||||
condition: "showWhisperToggle"
|
||||
};
|
||||
})
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue
Block a user