DEV: /channel -> /c chat route rename (#19782)
* DEV: Rnemae channel path to just c Also swap the channel id and channel slug params to be consistent with core. * linting * channel_path * params in wrong order * Drop slugify helper and channel route without slug * Request slug and route models through the channel model if possible * Add client side redirection for backwards-compatibility Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
This commit is contained in:
@@ -57,7 +57,7 @@ export default class ChatNotificationManager extends Service {
|
||||
|
||||
@bind
|
||||
_pageChanged(path) {
|
||||
this.set("_inChat", path.startsWith("/chat/channel/"));
|
||||
this.set("_inChat", path.startsWith("/chat/c/"));
|
||||
if (this._inChat) {
|
||||
this._chatPresenceChannel.enter({ onlyWhileActive: false });
|
||||
this._corePresenceChannel.leave();
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import slugifyChannel from "discourse/plugins/chat/discourse/lib/slugify-channel";
|
||||
import deprecated from "discourse-common/lib/deprecated";
|
||||
import userSearch from "discourse/lib/user-search";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
@@ -297,8 +296,8 @@ export default class Chat extends Service {
|
||||
|
||||
return this.router.transitionTo(
|
||||
"chat.channel",
|
||||
channel.slugifiedTitle,
|
||||
channel.id,
|
||||
slugifyChannel(channel),
|
||||
{ queryParams }
|
||||
);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user