Skip to content

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

UX: always hide livestream chat icon in header on zoom route (#45108)

Krisc93049d4af83
diff --git a/plugins/discourse-events/assets/javascripts/discourse/connectors/before-main-outlet/embeddable-chat-channel-connector.gjs b/plugins/discourse-events/assets/javascripts/discourse/connectors/before-main-outlet/embeddable-chat-channel-connector.gjs
index 22de1a54e23..1eb7a11c4c9 100644
--- a/plugins/discourse-events/assets/javascripts/discourse/connectors/before-main-outlet/embeddable-chat-channel-connector.gjs
+++ b/plugins/discourse-events/assets/javascripts/discourse/connectors/before-main-outlet/embeddable-chat-channel-connector.gjs
@@ -7,7 +7,6 @@ export default class EmbedableChatChannelConnector extends Component {
@service embeddableChat;
@service siteSettings;
@service capabilities;
- @service router;
get shouldRender() {
const mobileViewport =
@@ -18,17 +17,13 @@ export default class EmbedableChatChannelConnector extends Component {
return false;
}
- if (this.isZoomRoute) {
+ if (this.embeddableChat.isZoomRoute) {
return false;
}
return this.embeddableChat.canRenderChatChannel(mobileViewport);
}
- get isZoomRoute() {
- return this.router.currentRouteName === "topic-zoom";
- }
-
<template>
{{#if this.embeddableChat.useLivestreamLayout}}
{{bodyClass "livestream-topic"}}
diff --git a/plugins/discourse-events/assets/javascripts/discourse/services/embeddable-chat.gjs b/plugins/discourse-events/assets/javascripts/discourse/services/embeddable-chat.gjs
index 4c7209961a9..ccae23e4938 100644
--- a/plugins/discourse-events/assets/javascripts/discourse/services/embeddable-chat.gjs
+++ b/plugins/discourse-events/assets/javascripts/discourse/services/embeddable-chat.gjs
@@ -60,10 +60,16 @@ export default class EmbeddableChat extends Service {
this.isMobileViewport &&
this.livestreamChatActive &&
!!this.chatChannelId &&
+ !this.isZoomRoute &&
!this.hasActiveZoomLivestream
);
}
+ // The zoom page always renders the chat inline beside the meeting.
+ get isZoomRoute() {
+ return this.router.currentRouteName === "topic-zoom";
+ }
+
get hasActiveZoomLivestream() {
if (!this.siteSettings.livestream_zoom_enabled) {
return false;
diff --git a/plugins/discourse-events/test/javascripts/unit/services/embeddable-chat-test.js b/plugins/discourse-events/test/javascripts/unit/services/embeddable-chat-test.js
index 62f7f4fcc66..6ec00982565 100644
--- a/plugins/discourse-events/test/javascripts/unit/services/embeddable-chat-test.js
+++ b/plugins/discourse-events/test/javascripts/unit/services/embeddable-chat-test.js
@@ -127,6 +127,16 @@ module("Unit | Service | embeddable-chat", function (hooks) {
assert.false(this.subject.showLivestreamHeaderChatIcon);
});
+ test("hides the header chat icon on the zoom route", function (assert) {
+ this.capabilities.viewport.lg = false;
+ this.router.currentRouteName = "topic-zoom";
+
+ assert.false(
+ this.subject.showLivestreamHeaderChatIcon,
+ "even when the event is not a zoom livestream"
+ );
+ });
+
test("hides the header chat icon on a zoom livestream", function (assert) {
const owner = getOwner(this);
owner.lookup("service:site-settings").livestream_zoom_enabled = true;