mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 04:13:22 +08:00
FIX: do not show "create topics" notice on wizard route (#18153)
This commit is contained in:
parent
7e74dd0afe
commit
5bc858c676
|
@ -4,11 +4,13 @@ import I18n from "I18n";
|
|||
import LivePostCounts from "discourse/models/live-post-counts";
|
||||
import { alias } from "@ember/object/computed";
|
||||
import { htmlSafe } from "@ember/template";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
export default Component.extend({
|
||||
classNameBindings: ["hidden:hidden", ":create-topics-notice"],
|
||||
|
||||
enabled: false,
|
||||
router: service(),
|
||||
|
||||
publicTopicCount: null,
|
||||
publicPostCount: null,
|
||||
|
@ -37,14 +39,16 @@ export default Component.extend({
|
|||
}
|
||||
},
|
||||
|
||||
@discourseComputed()
|
||||
shouldSee() {
|
||||
const user = this.currentUser;
|
||||
@discourseComputed(
|
||||
"siteSettings.show_create_topics_notice",
|
||||
"router.currentRouteName"
|
||||
)
|
||||
shouldSee(showCreateTopicsNotice, currentRouteName) {
|
||||
return (
|
||||
user &&
|
||||
user.get("admin") &&
|
||||
this.siteSettings.show_create_topics_notice &&
|
||||
!this.site.get("wizard_required")
|
||||
this.currentUser?.get("admin") &&
|
||||
showCreateTopicsNotice &&
|
||||
!this.site.get("wizard_required") &&
|
||||
!currentRouteName.startsWith("wizard")
|
||||
);
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user