FIX: applies getURL on both app and chat URLs (#21847)

This commit is contained in:
Joffrey JAFFEUX 2023-05-31 01:30:54 +02:00 committed by GitHub
parent 83af25179d
commit 7c4d229f37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View File

@ -1,4 +1,3 @@
import getURL from "discourse-common/lib/get-url";
import Component from "@ember/component";
import { bind, observes } from "discourse-common/utils/decorators";
import { action } from "@ember/object";
@ -192,9 +191,7 @@ export default Component.extend({
this.chatStateManager.prefersFullPage();
this.chat.activeChannel = null;
return this.router.transitionTo(
getURL(this.chatStateManager.lastKnownChatURL)
);
return this.router.transitionTo(this.chatStateManager.lastKnownChatURL);
},
@action

View File

@ -3,6 +3,7 @@ import { defaultHomepage } from "discourse/lib/utilities";
import { tracked } from "@glimmer/tracking";
import KeyValueStore from "discourse/lib/key-value-store";
import Site from "discourse/models/site";
import getURL from "discourse-common/lib/get-url";
const PREFERRED_MODE_KEY = "preferred_mode";
const PREFERRED_MODE_STORE_NAMESPACE = "discourse_chat_";
@ -133,11 +134,11 @@ export default class ChatStateManager extends Service {
url = this.router.urlFor(`discovery.${defaultHomepage()}`);
}
return url;
return getURL(url);
}
get lastKnownChatURL() {
return this._chatURL || "/chat";
return getURL(this._chatURL || "/chat");
}
#publishStateChange() {