Skip to content

A platform for community discussion. Free, open, simple.

FIX: follow up to #7fca078 (#18915)

Joffrey JAFFEUX0a02a5d05ad7
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-live-pane.js b/plugins/chat/assets/javascripts/discourse/components/chat-live-pane.js
index 9cd66d58ab5..f55af46a07d 100644
--- a/plugins/chat/assets/javascripts/discourse/components/chat-live-pane.js
+++ b/plugins/chat/assets/javascripts/discourse/components/chat-live-pane.js
@@ -27,6 +27,7 @@ import {
} from "discourse/lib/user-presence";
import isZoomed from "discourse/plugins/chat/discourse/lib/zoom-check";
import { isTesting } from "discourse-common/config/environment";
+import { defaultHomepage } from "discourse/lib/utilities";
const MAX_RECENT_MSGS = 100;
const STICKY_SCROLL_LENIENCE = 50;
@@ -1266,11 +1267,10 @@ export default Component.extend({
@action
onCloseFullScreen(channel) {
this.chatPreferredMode.setDrawer();
- this.appEvents.trigger("chat:open-channel", channel);
let previousURL = this.fullPageChat.exit();
if (!previousURL || previousURL === "/") {
- previousURL = "discovery";
+ previousURL = this.router.urlFor(`discovery.${defaultHomepage()}`);
}
this.router.replaceWith(previousURL).then(() => {
diff --git a/plugins/chat/spec/system/navigation_spec.rb b/plugins/chat/spec/system/navigation_spec.rb
index 851a48c86bf..4bc4e41f57a 100644
--- a/plugins/chat/spec/system/navigation_spec.rb
+++ b/plugins/chat/spec/system/navigation_spec.rb
@@ -79,7 +79,7 @@ RSpec.describe "Navigation", type: :system, js: true do
chat_page.open_full_page
chat_page.minimize_full_page
- expect(page).to have_current_path("/")
+ expect(page).to have_current_path(latest_path)
end
end