mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 15:32:26 +08:00
FIX: uses DiscourseURL.routeTo for drawer transitions (#21850)
Calling `transitionTo` directly was bypassing various custom codepaths of core.
This commit is contained in:
parent
473992bd36
commit
80c18b97b4
|
@ -21,6 +21,7 @@ import {
|
||||||
import isZoomed from "discourse/plugins/chat/discourse/lib/zoom-check";
|
import isZoomed from "discourse/plugins/chat/discourse/lib/zoom-check";
|
||||||
import { tracked } from "@glimmer/tracking";
|
import { tracked } from "@glimmer/tracking";
|
||||||
import discourseDebounce from "discourse-common/lib/debounce";
|
import discourseDebounce from "discourse-common/lib/debounce";
|
||||||
|
import DiscourseURL from "discourse/lib/url";
|
||||||
|
|
||||||
const PAGE_SIZE = 50;
|
const PAGE_SIZE = 50;
|
||||||
const PAST = "past";
|
const PAST = "past";
|
||||||
|
@ -815,11 +816,14 @@ export default class ChatLivePane extends Component {
|
||||||
@action
|
@action
|
||||||
onCloseFullScreen() {
|
onCloseFullScreen() {
|
||||||
this.chatStateManager.prefersDrawer();
|
this.chatStateManager.prefersDrawer();
|
||||||
this.router.transitionTo(this.chatStateManager.lastKnownAppURL).then(() => {
|
|
||||||
|
DiscourseURL.routeTo(this.chatStateManager.lastKnownAppURL, {
|
||||||
|
afterRouteComplete: () => {
|
||||||
this.appEvents.trigger(
|
this.appEvents.trigger(
|
||||||
"chat:open-url",
|
"chat:open-url",
|
||||||
this.chatStateManager.lastKnownChatURL
|
this.chatStateManager.lastKnownChatURL
|
||||||
);
|
);
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { cancel, throttle } from "@ember/runloop";
|
||||||
import { inject as service } from "@ember/service";
|
import { inject as service } from "@ember/service";
|
||||||
import { htmlSafe } from "@ember/template";
|
import { htmlSafe } from "@ember/template";
|
||||||
import { escapeExpression } from "discourse/lib/utilities";
|
import { escapeExpression } from "discourse/lib/utilities";
|
||||||
|
import DiscourseURL from "discourse/lib/url";
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
tagName: "",
|
tagName: "",
|
||||||
|
@ -191,7 +192,7 @@ export default Component.extend({
|
||||||
this.chatStateManager.prefersFullPage();
|
this.chatStateManager.prefersFullPage();
|
||||||
this.chat.activeChannel = null;
|
this.chat.activeChannel = null;
|
||||||
|
|
||||||
return this.router.transitionTo(this.chatStateManager.lastKnownChatURL);
|
return DiscourseURL.routeTo(this.chatStateManager.lastKnownChatURL);
|
||||||
},
|
},
|
||||||
|
|
||||||
@action
|
@action
|
||||||
|
|
Loading…
Reference in New Issue
Block a user