UX: highlight the chat channel/DM only when chat is expanded (#28488)
This commit is contained in:
parent
437d7a0ad1
commit
a12b933f5c
|
@ -51,6 +51,7 @@ export default {
|
||||||
const chatChannelsManager = container.lookup(
|
const chatChannelsManager = container.lookup(
|
||||||
"service:chat-channels-manager"
|
"service:chat-channels-manager"
|
||||||
);
|
);
|
||||||
|
const chatStateManager = container.lookup("service:chat-state-manager");
|
||||||
|
|
||||||
api.addSidebarSection(
|
api.addSidebarSection(
|
||||||
(BaseCustomSidebarSection, BaseCustomSidebarSectionLink) => {
|
(BaseCustomSidebarSection, BaseCustomSidebarSectionLink) => {
|
||||||
|
@ -119,6 +120,7 @@ export default {
|
||||||
super(...arguments);
|
super(...arguments);
|
||||||
this.channel = channel;
|
this.channel = channel;
|
||||||
this.chatService = chatService;
|
this.chatService = chatService;
|
||||||
|
this.chatStateManager = chatStateManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
get name() {
|
get name() {
|
||||||
|
@ -132,7 +134,11 @@ export default {
|
||||||
classes.push("sidebar-section-link--muted");
|
classes.push("sidebar-section-link--muted");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.channel.id === this.chatService.activeChannel?.id) {
|
if (
|
||||||
|
this.channel.id === this.chatService.activeChannel?.id &&
|
||||||
|
(this.chatStateManager.isDrawerExpanded ||
|
||||||
|
this.chatStateManager.isFullPageActive)
|
||||||
|
) {
|
||||||
classes.push("sidebar-section-link--active");
|
classes.push("sidebar-section-link--active");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -289,6 +295,7 @@ export default {
|
||||||
this.channel = channel;
|
this.channel = channel;
|
||||||
this.chatService = chatService;
|
this.chatService = chatService;
|
||||||
this.currentUser = currentUser;
|
this.currentUser = currentUser;
|
||||||
|
this.chatStateManager = chatStateManager;
|
||||||
|
|
||||||
if (this.oneOnOneMessage) {
|
if (this.oneOnOneMessage) {
|
||||||
const user = this.channel.chatable.users[0];
|
const user = this.channel.chatable.users[0];
|
||||||
|
@ -330,7 +337,11 @@ export default {
|
||||||
classes.push("sidebar-section-link--muted");
|
classes.push("sidebar-section-link--muted");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.channel.id === this.chatService.activeChannel?.id) {
|
if (
|
||||||
|
this.channel.id === this.chatService.activeChannel?.id &&
|
||||||
|
(this.chatStateManager.isDrawerExpanded ||
|
||||||
|
this.chatStateManager.isFullPageActive)
|
||||||
|
) {
|
||||||
classes.push("sidebar-section-link--active");
|
classes.push("sidebar-section-link--active");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue