FIX: close panel earlier (#21512)

deactivate was happening too late and sometimes after we did reopen for next panel causing the panel to stay effectively closed
This commit is contained in:
Joffrey JAFFEUX 2023-05-11 21:15:31 +02:00 committed by GitHub
parent bd6e487df0
commit e905de66ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

View File

@ -1,5 +1,6 @@
import DiscourseRoute from "discourse/routes/discourse";
import { inject as service } from "@ember/service";
import { action } from "@ember/object";
export default class ChatChannelThread extends DiscourseRoute {
@service router;
@ -24,7 +25,8 @@ export default class ChatChannelThread extends DiscourseRoute {
this.chatChannelThreadPane.open(model);
}
deactivate() {
@action
willTransition() {
this.chatChannelThreadPane.close();
}

View File

@ -1,14 +1,10 @@
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;
deactivate() {
this.chatChannelThreadListPane.close();
}
beforeModel(transition) {
const channel = this.modelFor("chat.channel");
@ -19,6 +15,11 @@ export default class ChatChannelThreads extends DiscourseRoute {
}
}
@action
willTransition() {
this.chatChannelThreadListPane.close();
}
activate() {
this.chatChannelThreadListPane.open();
}