mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 23:03:38 +08:00
FIX: TopicTrackingState was initialized after Site (#11732)
This commit is contained in:
parent
f772a0beac
commit
06d318820a
|
@ -45,19 +45,23 @@ export default {
|
||||||
const currentUser = User.current();
|
const currentUser = User.current();
|
||||||
app.register("current-user:main", currentUser, { instantiate: false });
|
app.register("current-user:main", currentUser, { instantiate: false });
|
||||||
app.currentUser = currentUser;
|
app.currentUser = currentUser;
|
||||||
|
|
||||||
|
ALL_TARGETS.forEach((t) =>
|
||||||
|
app.inject(t, "topicTrackingState", "topic-tracking-state:main")
|
||||||
|
);
|
||||||
|
|
||||||
const topicTrackingState = TopicTrackingState.create({
|
const topicTrackingState = TopicTrackingState.create({
|
||||||
messageBus: MessageBus,
|
messageBus: MessageBus,
|
||||||
siteSettings,
|
siteSettings,
|
||||||
currentUser,
|
currentUser,
|
||||||
});
|
});
|
||||||
|
|
||||||
const site = Site.current();
|
|
||||||
app.register("site:main", site, { instantiate: false });
|
|
||||||
|
|
||||||
app.register("topic-tracking-state:main", topicTrackingState, {
|
app.register("topic-tracking-state:main", topicTrackingState, {
|
||||||
instantiate: false,
|
instantiate: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const site = Site.current();
|
||||||
|
app.register("site:main", site, { instantiate: false });
|
||||||
|
|
||||||
const session = Session.current();
|
const session = Session.current();
|
||||||
app.register("session:main", session, { instantiate: false });
|
app.register("session:main", session, { instantiate: false });
|
||||||
|
|
||||||
|
@ -90,10 +94,6 @@ export default {
|
||||||
app.inject(t, "siteSettings", "site-settings:main")
|
app.inject(t, "siteSettings", "site-settings:main")
|
||||||
);
|
);
|
||||||
|
|
||||||
ALL_TARGETS.forEach((t) =>
|
|
||||||
app.inject(t, "topicTrackingState", "topic-tracking-state:main")
|
|
||||||
);
|
|
||||||
|
|
||||||
ALL_TARGETS.forEach((t) => app.inject(t, "site", "site:main"));
|
ALL_TARGETS.forEach((t) => app.inject(t, "site", "site:main"));
|
||||||
|
|
||||||
ALL_TARGETS.forEach((t) =>
|
ALL_TARGETS.forEach((t) =>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user