mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
This reverts commit 33db93c9b2.
This commit is contained in:
@@ -1,13 +1,9 @@
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
export default class ChatBrowseIndexRoute extends DiscourseRoute {
|
||||
@service router;
|
||||
@service siteSettings;
|
||||
|
||||
afterModel() {
|
||||
if (!this.siteSettings.chat_allow_archiving_channels) {
|
||||
this.router.replaceWith("chat.browse");
|
||||
this.replaceWith("chat.browse");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,6 @@ export default class ChatBrowseIndexRoute extends DiscourseRoute {
|
||||
}
|
||||
|
||||
afterModel() {
|
||||
this.router.replaceWith("chat.browse.open");
|
||||
this.replaceWith("chat.browse.open");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
export default class ChatChannelInfoAboutRoute extends DiscourseRoute {
|
||||
@service router;
|
||||
|
||||
afterModel(model) {
|
||||
if (model.isDirectMessageChannel) {
|
||||
this.router.replaceWith("chat.channel.info.index");
|
||||
this.replaceWith("chat.channel.info.index");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
export default class ChatChannelInfoIndexRoute extends DiscourseRoute {
|
||||
@service router;
|
||||
|
||||
afterModel(model) {
|
||||
if (model.isDirectMessageChannel) {
|
||||
if (model.isOpen && model.membershipsCount >= 1) {
|
||||
this.router.replaceWith("chat.channel.info.members");
|
||||
this.replaceWith("chat.channel.info.members");
|
||||
} else {
|
||||
this.router.replaceWith("chat.channel.info.settings");
|
||||
this.replaceWith("chat.channel.info.settings");
|
||||
}
|
||||
} else {
|
||||
this.router.replaceWith("chat.channel.info.about");
|
||||
this.replaceWith("chat.channel.info.about");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
export default class ChatChannelInfoMembersRoute extends DiscourseRoute {
|
||||
@service router;
|
||||
|
||||
afterModel(model) {
|
||||
if (!model.isOpen) {
|
||||
return this.router.replaceWith("chat.channel.info.settings");
|
||||
return this.replaceWith("chat.channel.info.settings");
|
||||
}
|
||||
|
||||
if (model.membershipsCount < 1) {
|
||||
return this.router.replaceWith("chat.channel.info");
|
||||
return this.replaceWith("chat.channel.info");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
export default class ChatChannelInfoSettingsRoute extends DiscourseRoute {
|
||||
@service router;
|
||||
@service currentUser;
|
||||
|
||||
afterModel(model) {
|
||||
if (!this.currentUser?.staff && !model.currentUserMembership?.following) {
|
||||
this.router.replaceWith("chat.channel.info");
|
||||
this.replaceWith("chat.channel.info");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ export default class ChatMessageRoute extends DiscourseRoute {
|
||||
params.messageId
|
||||
);
|
||||
})
|
||||
.catch(() => this.router.replaceWith("/404"));
|
||||
.catch(() => this.replaceWith("/404"));
|
||||
}
|
||||
|
||||
beforeModel() {
|
||||
|
||||
Reference in New Issue
Block a user