UX: brings back URL on chat icon when in full page (#20092)
This commit is contained in:
parent
c3e978ada9
commit
697779b7e2
|
@ -1,21 +1,11 @@
|
||||||
{{#if (and this.chatStateManager.isFullPageActive this.site.desktopView)}}
|
<a
|
||||||
<span class={{concat-class "icon" (if this.isActive "active")}}>
|
href={{this.href}}
|
||||||
{{d-icon "comment"}}
|
tabindex="0"
|
||||||
|
class={{concat-class "icon" (if this.isActive "active")}}
|
||||||
|
>
|
||||||
|
{{d-icon "comment"}}
|
||||||
|
|
||||||
{{#unless this.currentUserInDnD}}
|
{{#unless this.currentUserInDnD}}
|
||||||
<ChatHeaderIconUnreadIndicator />
|
<ChatHeaderIconUnreadIndicator />
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
</span>
|
</a>
|
||||||
{{else}}
|
|
||||||
<a
|
|
||||||
href={{this.href}}
|
|
||||||
tabindex="0"
|
|
||||||
class={{concat-class "icon" (if this.isActive "active")}}
|
|
||||||
>
|
|
||||||
{{d-icon "comment"}}
|
|
||||||
|
|
||||||
{{#unless this.currentUserInDnD}}
|
|
||||||
<ChatHeaderIconUnreadIndicator />
|
|
||||||
{{/unless}}
|
|
||||||
</a>
|
|
||||||
{{/if}}
|
|
||||||
|
|
|
@ -1,25 +1,31 @@
|
||||||
import { inject as service } from "@ember/service";
|
import { inject as service } from "@ember/service";
|
||||||
import Component from "@glimmer/component";
|
import Component from "@glimmer/component";
|
||||||
|
import getURL from "discourse-common/lib/get-url";
|
||||||
|
|
||||||
export default class ChatHeaderIcon extends Component {
|
export default class ChatHeaderIcon extends Component {
|
||||||
@service currentUser;
|
@service currentUser;
|
||||||
@service site;
|
@service site;
|
||||||
@service chatStateManager;
|
@service chatStateManager;
|
||||||
|
@service router;
|
||||||
|
|
||||||
get currentUserInDnD() {
|
get currentUserInDnD() {
|
||||||
return this.currentUser.isInDoNotDisturb();
|
return this.currentUser.isInDoNotDisturb();
|
||||||
}
|
}
|
||||||
|
|
||||||
get href() {
|
get href() {
|
||||||
if (this.chatStateManager.isFullPageActive && this.site.mobileView) {
|
if (this.chatStateManager.isFullPageActive) {
|
||||||
return "/chat";
|
if (this.site.mobileView) {
|
||||||
|
return getURL("/chat");
|
||||||
|
} else {
|
||||||
|
return getURL(this.router.currentURL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.chatStateManager.isDrawerActive) {
|
if (this.chatStateManager.isDrawerActive) {
|
||||||
return "/chat";
|
return getURL("/chat");
|
||||||
} else {
|
|
||||||
return this.chatStateManager.lastKnownChatURL || "/chat";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return getURL(this.chatStateManager.lastKnownChatURL || "/chat");
|
||||||
}
|
}
|
||||||
|
|
||||||
get isActive() {
|
get isActive() {
|
||||||
|
|
Loading…
Reference in New Issue