Skip to content

A platform for community discussion. Free, open, simple.

FIX: close panel earlier (#21512)

Joffrey JAFFEUXe905de66ff5e
diff --git a/plugins/chat/assets/javascripts/discourse/routes/chat-channel-thread.js b/plugins/chat/assets/javascripts/discourse/routes/chat-channel-thread.js
index ab772ab4675..362c385417e 100644
--- a/plugins/chat/assets/javascripts/discourse/routes/chat-channel-thread.js
+++ b/plugins/chat/assets/javascripts/discourse/routes/chat-channel-thread.js
@@ -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();
}
diff --git a/plugins/chat/assets/javascripts/discourse/routes/chat-channel-threads.js b/plugins/chat/assets/javascripts/discourse/routes/chat-channel-threads.js
index 0198d703861..aca770abcd2 100644
--- a/plugins/chat/assets/javascripts/discourse/routes/chat-channel-threads.js
+++ b/plugins/chat/assets/javascripts/discourse/routes/chat-channel-threads.js
@@ -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();
}