UX: do not show selected composer education messages on whisper post (#14078)

This commit disables the "sequential_replies" and "duplicate_link"
education message on composer when creating a whipser post.
This commit is contained in:
Arpit Jalan 2021-08-19 09:32:32 +05:30 committed by GitHub
parent a50cb61dd5
commit c481f2ce16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View File

@ -130,7 +130,12 @@ export default Component.extend({
} }
} }
this.queuedForTyping.forEach((msg) => this.send("popup", msg)); this.queuedForTyping.forEach((msg) => {
if (composer.whisper && msg.hide_if_whisper) {
return;
}
this.send("popup", msg);
});
}, },
_create(info) { _create(info) {

View File

@ -501,7 +501,7 @@ export default Controller.extend({
const [linkWarn, linkInfo] = linkLookup.check(post, href); const [linkWarn, linkInfo] = linkLookup.check(post, href);
if (linkWarn) { if (linkWarn && !this.get("isWhispering")) {
const body = I18n.t("composer.duplicate_link", { const body = I18n.t("composer.duplicate_link", {
domain: linkInfo.domain, domain: linkInfo.domain,
username: linkInfo.username, username: linkInfo.username,

View File

@ -117,6 +117,7 @@ class ComposerMessagesFinder
templateName: 'education', templateName: 'education',
wait_for_typing: true, wait_for_typing: true,
extraClass: 'education-message', extraClass: 'education-message',
hide_if_whisper: true,
body: PrettyText.cook(I18n.t('education.sequential_replies')) body: PrettyText.cook(I18n.t('education.sequential_replies'))
} }
end end