mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 10:20:58 -06:00
UX: opens side panel early to avoid jitter (#21516)
Hard to write a test for this behavior, this is a micro optimisation which doesn’t change the behavior but only makes it smoother by happening right before async request.
This commit is contained in:
parent
74f01b8cbd
commit
c8eb1a275c
@ -59,5 +59,7 @@ export default class ChatChannelThread extends DiscourseRoute {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.chatStateManager.openSidePanel();
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,11 @@
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { action } from "@ember/object";
|
||||
|
||||
export default class ChatChannelThreads extends DiscourseRoute {
|
||||
@service router;
|
||||
@service chatChannelThreadListPane;
|
||||
@service chatStateManager;
|
||||
|
||||
beforeModel(transition) {
|
||||
const channel = this.modelFor("chat.channel");
|
||||
@ -13,11 +15,15 @@ export default class ChatChannelThreads extends DiscourseRoute {
|
||||
this.router.transitionTo("chat.channel", ...channel.routeModels);
|
||||
return;
|
||||
}
|
||||
|
||||
this.chatStateManager.openSidePanel();
|
||||
}
|
||||
|
||||
@action
|
||||
willTransition() {
|
||||
this.chatChannelThreadListPane.close();
|
||||
willTransition(transition) {
|
||||
if (transition.targetName !== "chat.channel.thread") {
|
||||
this.chatChannelThreadListPane.close();
|
||||
}
|
||||
}
|
||||
|
||||
activate() {
|
||||
|
Loading…
Reference in New Issue
Block a user