mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 06:56:01 +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 LivePostCounts from "discourse/models/live-post-counts";
|
||||||
import { alias } from "@ember/object/computed";
|
import { alias } from "@ember/object/computed";
|
||||||
import { htmlSafe } from "@ember/template";
|
import { htmlSafe } from "@ember/template";
|
||||||
|
import { inject as service } from "@ember/service";
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
classNameBindings: ["hidden:hidden", ":create-topics-notice"],
|
classNameBindings: ["hidden:hidden", ":create-topics-notice"],
|
||||||
|
|
||||||
enabled: false,
|
enabled: false,
|
||||||
|
router: service(),
|
||||||
|
|
||||||
publicTopicCount: null,
|
publicTopicCount: null,
|
||||||
publicPostCount: null,
|
publicPostCount: null,
|
||||||
|
@ -37,14 +39,16 @@ export default Component.extend({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@discourseComputed()
|
@discourseComputed(
|
||||||
shouldSee() {
|
"siteSettings.show_create_topics_notice",
|
||||||
const user = this.currentUser;
|
"router.currentRouteName"
|
||||||
|
)
|
||||||
|
shouldSee(showCreateTopicsNotice, currentRouteName) {
|
||||||
return (
|
return (
|
||||||
user &&
|
this.currentUser?.get("admin") &&
|
||||||
user.get("admin") &&
|
showCreateTopicsNotice &&
|
||||||
this.siteSettings.show_create_topics_notice &&
|
!this.site.get("wizard_required") &&
|
||||||
!this.site.get("wizard_required")
|
!currentRouteName.startsWith("wizard")
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user